1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-25 03:09:47 +01:00

systemd: revert systemd-environment-generator usage for environment variables (#2001)

This commit is contained in:
Tad Fisher 2021-05-16 14:43:50 -07:00 committed by GitHub
parent 77188bcd6e
commit 01ec2aaefe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 12 deletions

View file

@ -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}";
}) })

View file

@ -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)
'';
}) })
]; ];
} }

View file

@ -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 = ''

View file

@ -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}"'
''; '';
}; };
} }

View file

@ -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)'
''; '';
}; };
} }