From f15c764b1449f45c9034b2f67873f8c4164ea21c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sat, 23 May 2026 13:19:27 +0200 Subject: [PATCH] password-store: improve warning message --- modules/programs/password-store.nix | 2 +- tests/modules/programs/password-store/old-default-path.nix | 6 +++--- .../services/pass-secret-service/old-default-path.nix | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/programs/password-store.nix b/modules/programs/password-store.nix index 33dc84530..4b0e7d017 100644 --- a/modules/programs/password-store.nix +++ b/modules/programs/password-store.nix @@ -23,7 +23,7 @@ let value = { PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store"; }; - text = ''{ PASSWORD_STORE_DIR = "$XDG_DATA_HOME/password-store"; }''; + text = ''{ PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/password-store"; }''; }; current.value = { }; deferWarningToConfig = true; diff --git a/tests/modules/programs/password-store/old-default-path.nix b/tests/modules/programs/password-store/old-default-path.nix index ae08f5be9..bd6ca0cc7 100644 --- a/tests/modules/programs/password-store/old-default-path.nix +++ b/tests/modules/programs/password-store/old-default-path.nix @@ -5,10 +5,10 @@ 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". + The default value of `programs.password-store.settings` has changed from `{ PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/password-store"; }` to `{ }`. + You are currently using the legacy default (`{ PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/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"; }; + programs.password-store.settings = { PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/password-store"; }; To adopt the new default behavior, set: programs.password-store.settings = { }; '' diff --git a/tests/modules/services/pass-secret-service/old-default-path.nix b/tests/modules/services/pass-secret-service/old-default-path.nix index b0d1ab6bd..249cb7f26 100644 --- a/tests/modules/services/pass-secret-service/old-default-path.nix +++ b/tests/modules/services/pass-secret-service/old-default-path.nix @@ -10,10 +10,10 @@ 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". + The default value of `programs.password-store.settings` has changed from `{ PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/password-store"; }` to `{ }`. + You are currently using the legacy default (`{ PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/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"; }; + programs.password-store.settings = { PASSWORD_STORE_DIR = "''${config.xdg.dataHome}/password-store"; }; To adopt the new default behavior, set: programs.password-store.settings = { }; ''