2.home-manager/tests/modules/programs/password-store/old-default-path.nix
Austin Horstman 1eb0549a1a password-store: silence settings default warning
Use the deferred state-version helper mode for programs.password-store.settings
so explicit empty and explicit legacy values silence the warning correctly,
while partial legacy-era settings still inherit PASSWORD_STORE_DIR until the
user resolves the migration.

Add integration coverage for password-store and pass-secret-service to verify
legacy, explicit empty, explicit legacy, and partial-settings behavior.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2026-03-24 14:08:36 -05:00

21 lines
895 B
Nix

{ config, ... }:
{
home.stateVersion = "25.05"; # <= 25.11
programs.password-store.enable = true;
test.asserts.warnings.expected = [
''
The default value of `programs.password-store.settings` has changed from `{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }` to `{ }`.
You are currently using the legacy default (`{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }`) because `home.stateVersion` is less than "25.11".
To silence this warning and keep legacy behavior, set:
programs.password-store.settings = { PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; };
To adopt the new default behavior, set:
programs.password-store.settings = { };
''
];
nmt.script = ''
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
'export PASSWORD_STORE_DIR="${config.xdg.dataHome}/password-store"'
'';
}