diff --git a/docs/release-notes/rl-2511.md b/docs/release-notes/rl-2511.md index 9744e985..f6d23c5e 100644 --- a/docs/release-notes/rl-2511.md +++ b/docs/release-notes/rl-2511.md @@ -77,4 +77,7 @@ The state version in this release includes the changes below. These changes are only active if the `home.stateVersion` option is set to \"25.11\" or later. -- No changes. +- The `programs.password-store.settings` option does not set + `{ PASSWORD_STORE_DIR = $XDG_DATA_HOME/password-store; }` anymore by its + default value. This will revert to the default behaviour of the program, + namely `$HOME/.password-store` to be used as the store path. diff --git a/modules/programs/password-store.nix b/modules/programs/password-store.nix index ebdcf27f..01f16a32 100644 --- a/modules/programs/password-store.nix +++ b/modules/programs/password-store.nix @@ -24,15 +24,20 @@ in settings = mkOption rec { type = with types; attrsOf str; apply = lib.mergeAttrs default; - default = { - PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store"; - }; + default = + if lib.versionOlder config.home.stateVersion "25.11" then + { + PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store"; + } + else + { }; defaultText = literalExpression '' - { PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; } + { } for state version ≥ 25.11 + { PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; } for state version < 25.11 ''; example = literalExpression '' { - PASSWORD_STORE_DIR = "/some/directory"; + PASSWORD_STORE_DIR = "$\{config.xdg.dataHome\}/password-store"; PASSWORD_STORE_KEY = "12345678"; PASSWORD_STORE_CLIP_TIME = "60"; } @@ -52,7 +57,9 @@ in home.packages = [ cfg.package ]; home.sessionVariables = cfg.settings; - services.pass-secret-service.storePath = lib.mkDefault cfg.settings.PASSWORD_STORE_DIR; + services.pass-secret-service = lib.mkIf (builtins.hasAttr "PASSWORD_STORE_DIR" cfg.settings) { + storePath = cfg.settings.PASSWORD_STORE_DIR; + }; xsession.importedVariables = lib.mkIf config.xsession.enable ( lib.mapAttrsToList (name: value: name) cfg.settings diff --git a/modules/services/pass-secret-service.nix b/modules/services/pass-secret-service.nix index 0d079932..8b532f43 100644 --- a/modules/services/pass-secret-service.nix +++ b/modules/services/pass-secret-service.nix @@ -28,10 +28,11 @@ in defaultText = "$HOME/.password-store"; example = "/home/user/.local/share/password-store"; description = '' - Absolute path to password store. Defaults to - {file}`$HOME/.password-store` if the - {option}`programs.password-store` module is not enabled, and - {option}`programs.password-store.settings.PASSWORD_STORE_DIR` if it is. + Absolute path to password store, default upstream value of which is + {file}`$HOME/.password-store`. If the + {option}`programs.password-store` module is enabled and + {option}`programs.password-store.settings.PASSWORD_STORE_DIR` is set, + it will inherit the value from the latter. ''; }; };