aboutsummaryrefslogtreecommitdiffstats
path: root/modules/office/khal/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/office/khal/default.nix')
-rw-r--r--modules/office/khal/default.nix69
1 files changed, 69 insertions, 0 deletions
diff --git a/modules/office/khal/default.nix b/modules/office/khal/default.nix
new file mode 100644
index 0000000..8d924f5
--- /dev/null
+++ b/modules/office/khal/default.nix
@@ -0,0 +1,69 @@
+# CLI calendar application (khal)
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+let
+ cfg = config.office.khal;
+ icons = config.desktop.icons.apps;
+ calendarPath = "${config.xdg.dataHome}/khal/calendars";
+ base16Colors = import ../../colors/base16 { inherit config lib pkgs; };
+in
+{
+ options.office.khal = {
+ enable = lib.mkEnableOption "khal, a CLI calendar application";
+ package = lib.mkOption {
+ type = lib.types.package;
+ readOnly = true;
+ default = config.programs.khal.package;
+ description = "The khal package to use.";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.khal = {
+ enable = true;
+ locale = {
+ timeformat = "%H:%M";
+ dateformat = "%Y-%m-%d";
+ longdateformat = "%Y-%m-%d";
+ datetimeformat = "%Y-%m-%d %H:%M";
+ longdatetimeformat = "%Y-%m-%d %H:%M";
+ };
+ settings.default = {
+ default_calendar = "personal";
+ default_dayevent_duration = "1d";
+ default_event_duration = "1h";
+ enable_mouse = true;
+ timedelta = "2d";
+ };
+ settings.view.theme = "dark";
+ };
+
+ accounts.calendar = {
+ basePath = calendarPath;
+ accounts.personal = {
+ khal = {
+ enable = true;
+ color = base16Colors.colorsWithHashPrefix.base0D;
+ };
+ local.type = "filesystem";
+ };
+ };
+
+ xdg.desktopEntries."khal" = lib.mkIf (config.terminal.kitty.enable && cfg.package != null) {
+ name = "khal";
+ exec = "${lib.getExe config.terminal.kitty.package} --class khal -e ${lib.getExe' cfg.package "khal"} interactive";
+ icon = icons.khal or "calendar";
+ categories = [
+ "Office"
+ "Calendar"
+ ];
+ comment = "CLI calendar application";
+ terminal = false;
+ type = "Application";
+ };
+ };
+}