impermanence: link home profile during system activation

This commit is contained in:
Kevin Baensch 2025-01-12 13:07:30 +01:00
parent 2a8206d76c
commit be54cb5a31
Signed by: derped
GPG key ID: C0F1D326C7626543

View file

@ -64,4 +64,19 @@ in
];
users = listToAttrs (map persistUser config.machine.administrators);
};
# link current home manager profile if it exists
# impermanence mounts come after system activation during boot
# we check the persistent location and link to the expected mount point
system.activationScripts.profile-init.text = concatStrings (
map (
user:
with user; # bash
''
if [[ -d /persist/home/${name}/.local/state/nix/profiles/profile ]]; then
ln -sfn /home/${name}/.local/state/nix/profiles/profile /home/${name}/.nix-profile
fi
''
) config.machine.administrators
);
}