diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-16 18:13:38 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-05-16 18:13:38 +0200 |
commit | f0954b3735b0f7deac6fe5626c72b09a407b023d (patch) | |
tree | a3f3c8dac6e5a468fb71d3f435ae42c7ad0a0685 /modules/by-name/ta/taskwarrior | |
parent | modules/common: Don't always persist `/var/{lib/nixos,log}` (diff) | |
download | nixos-config-f0954b3735b0f7deac6fe5626c72b09a407b023d.zip |
modules/{atuin,taskwarrior}: Make enabling age configurable
A VM/test without age keys still needs to be able to use this modules.
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/ta/taskwarrior/module.nix | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/by-name/ta/taskwarrior/module.nix b/modules/by-name/ta/taskwarrior/module.nix index 4c174244..bb881768 100644 --- a/modules/by-name/ta/taskwarrior/module.nix +++ b/modules/by-name/ta/taskwarrior/module.nix @@ -76,6 +76,8 @@ in { options.soispha.programs.taskwarrior = { enable = lib.mkEnableOption "taskwarrior"; + enableAge = lib.mkEnableOption "taskwarrior with age keys"; + includeFiles = lib.mkOption { type = lib.types.attrsOf lib.types.path; description = "Extra files to include in the taskwarrior config"; @@ -108,17 +110,17 @@ in { inherit mkHook; }; - age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf cfg.enable { + age.secrets.taskwarrior_sync_server_encryption_key = lib.mkIf (cfg.enable && cfg.enableAge) { file = ./secrets/sync_server_encryption_key.age; mode = "700"; owner = "soispha"; group = "users"; }; - soispha.programs.taskwarrior.includeFiles.syncServerSecret = lib.mkIf cfg.enable config.age.secrets.taskwarrior_sync_server_encryption_key.path; + soispha.programs.taskwarrior.includeFiles.syncServerSecret = lib.mkIf (cfg.enable && cfg.enableAge) config.age.secrets.taskwarrior_sync_server_encryption_key.path; home-manager.users.soispha = lib.mkIf cfg.enable { - services.taskwarrior-sync = { + services.taskwarrior-sync = lib.mkIf cfg.enableAge { enable = true; package = pkgs.taskwarrior3; }; @@ -148,7 +150,7 @@ in { }; }; - sync.server = { + sync.server = lib.mkIf cfg.enableAge { client_id = "a3619d43-031f-4f85-848f-5512804f9a1d"; url = "https://taskchampion.vhack.eu"; }; |