mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01:00
systemd: revert systemd-environment-generator usage for environment variables (#2001)
This commit is contained in:
parent
77188bcd6e
commit
01ec2aaefe
5 changed files with 9 additions and 12 deletions
|
@ -37,11 +37,17 @@ in {
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
(mkIf (cfg.config != [ ]) {
|
(mkIf (cfg.config != [ ]) {
|
||||||
|
home.sessionVariables.XDG_CONFIG_DIRS =
|
||||||
|
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||||
|
|
||||||
systemd.user.sessionVariables.XDG_CONFIG_DIRS =
|
systemd.user.sessionVariables.XDG_CONFIG_DIRS =
|
||||||
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
"${configDirs}\${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}";
|
||||||
})
|
})
|
||||||
|
|
||||||
(mkIf (cfg.data != [ ]) {
|
(mkIf (cfg.data != [ ]) {
|
||||||
|
home.sessionVariables.XDG_DATA_DIRS =
|
||||||
|
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||||
|
|
||||||
systemd.user.sessionVariables.XDG_DATA_DIRS =
|
systemd.user.sessionVariables.XDG_DATA_DIRS =
|
||||||
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
"${dataDirs}\${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}";
|
||||||
})
|
})
|
||||||
|
|
|
@ -333,11 +333,6 @@ in
|
||||||
unset systemdStatus
|
unset systemdStatus
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
|
|
||||||
# Export environment variables in systemd.user.sessionVariables to login shells.
|
|
||||||
home.sessionVariablesExtra = optionalString (cfg.sessionVariables != {}) ''
|
|
||||||
export $(${pkgs.systemd}/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
|
|
||||||
'';
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,6 @@ let
|
||||||
export XDG_CACHE_HOME="/home/hm-user/.cache"
|
export XDG_CACHE_HOME="/home/hm-user/.cache"
|
||||||
export XDG_CONFIG_HOME="/home/hm-user/.config"
|
export XDG_CONFIG_HOME="/home/hm-user/.config"
|
||||||
export XDG_DATA_HOME="/home/hm-user/.local/share"
|
export XDG_DATA_HOME="/home/hm-user/.local/share"
|
||||||
export $(${pkgs.systemd}/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
darwinExpected = ''
|
darwinExpected = ''
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
sessionVarsFile=home-path/etc/profile.d/hm-session-vars.sh
|
sessionVarsFile=home-path/etc/profile.d/hm-session-vars.sh
|
||||||
assertFileExists $sessionVarsFile
|
assertFileExists $sessionVarsFile
|
||||||
assertFileContains $sessionVarsFile \
|
assertFileContains $sessionVarsFile \
|
||||||
'export $(${pkgs.systemd}/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)'
|
'export XDG_CONFIG_DIRS="/etc/xdg:/foo/bar''${XDG_CONFIG_DIRS:+:$XDG_CONFIG_DIRS}"'
|
||||||
|
assertFileContains $sessionVarsFile \
|
||||||
|
'export XDG_DATA_DIRS="/usr/local/share:/usr/share:/baz/quux''${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"'
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,11 +15,6 @@
|
||||||
V_int=1
|
V_int=1
|
||||||
V_str=2
|
V_str=2
|
||||||
''}
|
''}
|
||||||
|
|
||||||
sessionVarsFile=home-path/etc/profile.d/hm-session-vars.sh
|
|
||||||
assertFileExists $sessionVarsFile
|
|
||||||
assertFileContains $sessionVarsFile \
|
|
||||||
'export $(${pkgs.systemd}/lib/systemd/user-environment-generators/30-systemd-environment-d-generator)'
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue