xdg-user-dirs: warn on setSessionVariables default change
Switch xdg.userDirs.setSessionVariables to the shared state-version default helper so older configurations get an explicit warning before the legacy default is removed. Add focused tests for the legacy and current branches to verify that the session variable exports remain enabled before 26.05 and are disabled by default starting at 26.05. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
db91cbf795
commit
acf65ad748
4 changed files with 37 additions and 4 deletions
|
|
@ -136,10 +136,21 @@ in
|
|||
|
||||
setSessionVariables = mkOption {
|
||||
type = with types; bool;
|
||||
default = lib.versionOlder config.home.stateVersion "26.05";
|
||||
defaultText = literalExpression ''
|
||||
lib.versionOlder config.home.stateVersion "26.05"
|
||||
'';
|
||||
inherit
|
||||
(lib.hm.deprecations.mkStateVersionOptionDefault {
|
||||
inherit (config.home) stateVersion;
|
||||
since = "26.05";
|
||||
optionPath = [
|
||||
"xdg"
|
||||
"userDirs"
|
||||
"setSessionVariables"
|
||||
];
|
||||
legacy.value = true;
|
||||
current.value = false;
|
||||
})
|
||||
default
|
||||
defaultText
|
||||
;
|
||||
description = ''
|
||||
Whether to set the XDG user dir environment variables, like
|
||||
`XDG_DESKTOP_DIR`.
|
||||
|
|
|
|||
|
|
@ -7,4 +7,6 @@
|
|||
xdg-user-dirs-mixed = ./user-dirs-mixed.nix;
|
||||
xdg-user-dirs-null = ./user-dirs-null.nix;
|
||||
xdg-user-dirs-short = ./user-dirs-short.nix;
|
||||
xdg-user-dirs-session-vars-legacy = ./user-dirs-session-vars-legacy.nix;
|
||||
xdg-user-dirs-session-vars-current = ./user-dirs-session-vars-current.nix;
|
||||
}
|
||||
|
|
|
|||
10
tests/modules/misc/xdg/user-dirs-session-vars-current.nix
Normal file
10
tests/modules/misc/xdg/user-dirs-session-vars-current.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
home.stateVersion = "26.05";
|
||||
|
||||
xdg.userDirs.enable = true;
|
||||
|
||||
nmt.script = ''
|
||||
assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'^export XDG_DESKTOP_DIR='
|
||||
'';
|
||||
}
|
||||
10
tests/modules/misc/xdg/user-dirs-session-vars-legacy.nix
Normal file
10
tests/modules/misc/xdg/user-dirs-session-vars-legacy.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
home.stateVersion = "25.11";
|
||||
|
||||
xdg.userDirs.enable = true;
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
|
||||
'export XDG_DESKTOP_DIR="/home/hm-user/Desktop"'
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue