Closed rodrgz closed 1 year ago
Hi! If you want to use the home-manager module, you have to run home-manager through its NixOS module or it won't work as intended. See the note at https://github.com/nix-community/impermanence#home-manager.
I found the error. I am using
loginShellInit = '' [ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null '';
to activate home-manager environment, some of the steps inside the script are causing errors and are not related to impermanence. The activate script uses "set -e". Just one thing to note, is that using activate, folders are first created and mounted, then unmounted and remounted by systemd bindMount services.
I am using Impermanence in / and /home/, both created as tmpfs. For / is working correctly. But after reboot, for /home/user, the folders are empty, being linked only after using a "home-manager switch --flake ." .
It seems that systemd services to bindMount are only started after home-manager, and the "systemd enable" is not kept for the next boot.
imports = [ inputs.impermanence.nixosModules.home-manager.impermanence ];
home = { username = lib.mkDefault "erik"; homeDirectory = lib.mkDefault "/home/${config.home.username}"; stateVersion = lib.mkDefault "22.05";
};