From be54cb5a31e149706b05e4a6abcf13b2ae4eda6c Mon Sep 17 00:00:00 2001 From: derped Date: Sun, 12 Jan 2025 13:07:30 +0100 Subject: [PATCH] impermanence: link home profile during system activation --- services/impermanence.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/services/impermanence.nix b/services/impermanence.nix index 2d33846..45a4b43 100644 --- a/services/impermanence.nix +++ b/services/impermanence.nix @@ -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 + ); }