1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

applications: use system.primaryUser for the legacy path

System activation scripts shouldn’t (and soon won’t be able to)
rely on `$HOME` being the primary user’s.
This commit is contained in:
Emily 2025-01-11 15:44:41 +00:00
parent bc00d06ce0
commit dee253cf56

View file

@ -30,12 +30,15 @@ in
[ -L "$1" ] && [ "''${link#*-}" = 'system-applications/Applications' ]
}
# Clean up for links created at the old location in HOME
if ourLink ~/Applications; then
rm ~/Applications
elif ourLink ~/Applications/'Nix Apps'; then
rm ~/Applications/'Nix Apps'
fi
${lib.optionalString (config.system.primaryUser != null) ''
# Clean up for links created at the old location in HOME
# TODO: Remove this in 25.11.
if ourLink ~${config.system.primaryUser}/Applications; then
rm ~${config.system.primaryUser}/Applications
elif ourLink ~${config.system.primaryUser}/Applications/'Nix Apps'; then
rm ~${config.system.primaryUser}/Applications/'Nix Apps'
fi
''}
if [ ! -e '/Applications/Nix Apps' ] \
|| ourLink '/Applications/Nix Apps'; then