diff options
| author | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-20 04:00:07 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar@gmail.com> | 2026-09-20 04:00:07 +0530 |
| commit | fb442560064f98ee850c71d78330b9b3abda4774 (patch) | |
| tree | 31fad467ca31b2f9127f4ea254eab76f4ce18a5f /modules/office/calcurse/default.nix | |
| parent | c3c245c7633885f6860191eede646d048def3e0d (diff) | |
| download | home-manager-config-fb442560064f98ee850c71d78330b9b3abda4774.tar.gz home-manager-config-fb442560064f98ee850c71d78330b9b3abda4774.zip | |
chore: added option guards to desktop entries for tuis
Diffstat (limited to 'modules/office/calcurse/default.nix')
| -rw-r--r-- | modules/office/calcurse/default.nix | 119 |
1 files changed, 59 insertions, 60 deletions
diff --git a/modules/office/calcurse/default.nix b/modules/office/calcurse/default.nix index 2f86500..2b0a19f 100644 --- a/modules/office/calcurse/default.nix +++ b/modules/office/calcurse/default.nix @@ -71,69 +71,68 @@ in }; }; - config = lib.mkIf config.office.calcurse.enable ( - lib.mkMerge [ - { - home.file.".local/share/icons/hicolor/scalable/apps/calcurse.svg" = { - source = ../../../assets/icons/apps/calcurse.svg; - }; - - xdg.desktopEntries."calcurse" = { - name = "calcurse"; - exec = "${lib.getExe config.terminal.kitty.package} --class calcurse -e ${lib.getExe config.office.calcurse.package}"; - icon = "calcurse"; - categories = [ - "Office" - "Calendar" - ]; - comment = "Text-based calendar and scheduling application"; - terminal = false; - type = "Application"; - }; + config = lib.mkMerge [ + (lib.mkIf config.office.calcurse.enable { + home.file.".local/share/icons/hicolor/scalable/apps/calcurse.svg" = { + source = ../../../assets/icons/apps/calcurse.svg; + }; - home.packages = [ config.office.calcurse.package ]; - xdg.configFile."calcurse/conf" = { - source = ./conf; - force = true; - }; - xdg.configFile."calcurse/keys" = { - source = ./keys; - force = true; - }; - } - (lib.mkIf config.office.calcurse.sync.enable { - xdg.configFile."calcurse/hooks/pre-load" = { - source = ./hooks/pre-load; - executable = true; - force = true; - }; - xdg.configFile."calcurse/hooks/post-save" = { - source = ./hooks/post-save; - executable = true; - force = true; - }; + home.packages = [ config.office.calcurse.package ]; + xdg.configFile."calcurse/conf" = { + source = ./conf; + force = true; + }; + xdg.configFile."calcurse/keys" = { + source = ./keys; + force = true; + }; + }) + (lib.mkIf (config.office.calcurse.enable && config.terminal.kitty.enable) { + xdg.desktopEntries."calcurse" = { + name = "calcurse"; + exec = "${lib.getExe config.terminal.kitty.package} --class calcurse -e ${lib.getExe config.office.calcurse.package}"; + icon = "calcurse"; + categories = [ + "Office" + "Calendar" + ]; + comment = "Text-based calendar and scheduling application"; + terminal = false; + type = "Application"; + }; + }) + (lib.mkIf config.office.calcurse.sync.enable { + xdg.configFile."calcurse/hooks/pre-load" = { + source = ./hooks/pre-load; + executable = true; + force = true; + }; + xdg.configFile."calcurse/hooks/post-save" = { + source = ./hooks/post-save; + executable = true; + force = true; + }; - programs.git.includes = lib.mkIf config.development.git.enable [ - { - condition = "gitdir:${config.xdg.dataHome}/calcurse/"; - contents = { - user = { - name = "Calcurse of ${config.home.username}"; - email = "${config.home.username}@calcurse.localhost"; - }; - commit.gpgSign = false; - tag.gpgSign = false; - } - // lib.optionalAttrs (config.office.calcurse.sync.credential.passwordGopassPath != null) { - credential.helper = "!f() { echo username=${lib.escapeShellArg config.office.calcurse.sync.credential.username}; echo password=\"$(${lib.getExe config.security.gopass.package} show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f"; + programs.git.includes = lib.mkIf config.development.git.enable [ + { + condition = "gitdir:${config.xdg.dataHome}/calcurse/"; + contents = { + user = { + name = "Calcurse of ${config.home.username}"; + email = "${config.home.username}@calcurse.localhost"; }; + commit.gpgSign = false; + tag.gpgSign = false; } - ]; + // lib.optionalAttrs (config.office.calcurse.sync.credential.passwordGopassPath != null) { + credential.helper = "!f() { echo username=${lib.escapeShellArg config.office.calcurse.sync.credential.username}; echo password=\"$(${lib.getExe config.security.gopass.package} show -o ${lib.escapeShellArg config.office.calcurse.sync.credential.passwordGopassPath})\"; }; f"; + }; + } + ]; - home.activation.calcurseSyncInit = lib.hm.dag.entryAfter [ "writeBoundary" ] '' - run ${config.office.calcurse.package}/bin/calcurse-sync init || true - ''; - }) - ] - ); + home.activation.calcurseSyncInit = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + run ${config.office.calcurse.package}/bin/calcurse-sync init || true + ''; + }) + ]; } |
