From f0954b3735b0f7deac6fe5626c72b09a407b023d Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 16 May 2025 18:13:38 +0200 Subject: modules/{atuin,taskwarrior}: Make enabling age configurable A VM/test without age keys still needs to be able to use this modules. --- modules/by-name/at/atuin/module.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'modules/by-name/at') diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index 9e3f46a7..700f50fb 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -17,10 +17,12 @@ in { options.soispha.programs.atuin = { enable = lib.mkEnableOption "atuin"; + + enableAge = lib.mkEnableOption "atuin with age keys"; }; config = lib.mkIf cfg.enable { - age.secrets.atuin_encryption_key = { + age.secrets.atuin_encryption_key = lib.mkIf cfg.enableAge { file = ./secrets/encryption_key.age; mode = "700"; owner = "soispha"; @@ -37,14 +39,18 @@ in { # We can do this on our own. enableZshIntegration = false; settings = { - key_path = "${config.age.secrets.atuin_encryption_key.path}"; + key_path = lib.mkMerge [ + (lib.mkIf cfg.enableAge "${config.age.secrets.atuin_encryption_key.path}") + (lib.mkIf (!cfg.enableAge) + "${config.home-manager.users.soispha.xdg.dataHome}/atuin/atuin_secret_key.key") + ]; - sync = { + sync = lib.mkIf cfg.enableAge { # The v2 sync API records = true; }; - auto_sync = true; - sync_address = "https://atuin-sync.vhack.eu"; + auto_sync = lib.mkIf cfg.enableAge true; + sync_address = lib.mkIf cfg.enableAge "https://atuin-sync.vhack.eu"; # Use the rather reasonable syntax of `skim` to search. search_mode = "skim"; -- cgit 1.4.1