Make home-manager symlink .nix-profile to avoid activation failures
diff --git a/modules/home-manager.nix b/modules/home-manager.nix
index d5b9799..70f983c 100644
--- a/modules/home-manager.nix
+++ b/modules/home-manager.nix
@@ -11,4 +11,11 @@
inherit username inputs;
});
};
+ home.home.activation.linkProfile = home-manager.lib.hm.dag.entryBefore [
+ "installPackages"
+ ] ''
+ if [ ! -d /home/${username}/.nix-profile/ ]; then
+ ln -s /nix/var/nix/profiles/per-user/${username}/profile/ /home/${username}/.nix-profile
+ fi
+ '';
}