password-store: warn on settings default change
The default value of programs.password-store.settings changed in 25.11 when Home Manager stopped exporting PASSWORD_STORE_DIR implicitly. Route the default through the shared state-version helper so users on older state versions keep the compatibility behavior with a consistent warning and a single place to remove later. The existing password-store tests already cover the legacy default, the current empty default, and explicit override behavior, so no new test fixture is needed for this migration. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
@@ -24,17 +24,26 @@ in
|
||||
settings = mkOption rec {
|
||||
type = with types; attrsOf str;
|
||||
apply = lib.mergeAttrs default;
|
||||
default =
|
||||
if lib.versionOlder config.home.stateVersion "25.11" then
|
||||
{
|
||||
PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store";
|
||||
}
|
||||
else
|
||||
{ };
|
||||
defaultText = literalExpression ''
|
||||
{ } for state version ≥ 25.11
|
||||
{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; } for state version < 25.11
|
||||
'';
|
||||
inherit
|
||||
(lib.hm.deprecations.mkStateVersionOptionDefault {
|
||||
inherit (config.home) stateVersion;
|
||||
since = "25.11";
|
||||
optionPath = [
|
||||
"programs"
|
||||
"password-store"
|
||||
"settings"
|
||||
];
|
||||
legacy = {
|
||||
value = {
|
||||
PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store";
|
||||
};
|
||||
text = ''{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }'';
|
||||
};
|
||||
current.value = { };
|
||||
})
|
||||
default
|
||||
defaultText
|
||||
;
|
||||
example = literalExpression ''
|
||||
{
|
||||
PASSWORD_STORE_DIR = "$\{config.xdg.dataHome\}/password-store";
|
||||
|
||||
Reference in New Issue
Block a user