Merge pull request #272893 from foo-dogsquared/fix-nixos-guix-module

nixos/guix: fix user activation script
This commit is contained in:
Weijia Wang 2023-12-08 16:00:54 +01:00 committed by GitHub
commit 0e342e3226
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -265,7 +265,7 @@ in
linkProfileToPath = acc: profile: location: let
guixProfile = "${cfg.stateDir}/guix/profiles/per-user/\${USER}/${profile}";
in acc + ''
[ -d "${guixProfile}" ] && ln -sf "${guixProfile}" "${location}"
[ -d "${guixProfile}" ] && [ -L "${location}" ] || ln -sf "${guixProfile}" "${location}"
'';
activationScript = lib.foldlAttrs linkProfileToPath "" guixUserProfiles;