From 547895664b16dafb7088af7cce45d97a83bdfc31 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Wed, 23 Apr 2025 19:50:10 +0100 Subject: [PATCH] Make the pass extensions configurable --- hosts/t480/configuration.nix | 10 +++++++++- modules/nixos/cli/password-store.nix | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/hosts/t480/configuration.nix b/hosts/t480/configuration.nix index bfb0fc56..9f26b1f7 100644 --- a/hosts/t480/configuration.nix +++ b/hosts/t480/configuration.nix @@ -13,7 +13,15 @@ ]; nixosModules = { - cli.password-store.enable = true; + cli.password-store = { + enable = true; + + extensions = with pkgs.passExtensions; [ + pass-audit + pass-otp + pass-update + ]; + }; core = { bluetooth.enable = true; diff --git a/modules/nixos/cli/password-store.nix b/modules/nixos/cli/password-store.nix index 190e56c9..d943a186 100644 --- a/modules/nixos/cli/password-store.nix +++ b/modules/nixos/cli/password-store.nix @@ -11,20 +11,21 @@ let cfg = config.nixosModules.cli.password-store; in { - options.nixosModules.cli.password-store.enable = mkEnableOption "Enable pass"; + options.nixosModules.cli.password-store = { + enable = mkEnableOption "Enable pass"; + + extensions = mkOption { + default = [ ]; + type = types.listOf types.package; + description = "pass extensions to install."; + }; + }; config = mkIf cfg.enable { environment.systemPackages = with pkgs; [ passmenu-otp - (pass.withExtensions ( - e: with e; [ - passExtensions.pass-audit - passExtensions.pass-import - passExtensions.pass-otp - passExtensions.pass-update - ] - )) + (pass.withExtensions (e: with e; cfg.extensions)) ]; }; }