Home-manager with impermanent configuration

I recently managed to setup impermanence, everything seems to be imploading just right, unfortunatelly home manager refuses to work.

On each rebuild I’m getting this warning

× home-manager-unixpariah.service - Home Manager environment for unixpariah
     Loaded: loaded (/etc/systemd/system/home-manager-unixpariah.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Fri 2024-06-07 20:13:20 CEST; 100ms ago
   Duration: 7min 23.586s
    Process: 894133 ExecStart=/nix/store/7i0d80cp7l2f3kzphp2pgl75f8k9bqal-hm-setup-env /nix/store/ry1c1cr5zh2w50m1lhavm2i4vd6bnnz4-home-manager-generation (code=exited, status=1/FAILURE)
   Main PID: 894133 (code=exited, status=1/FAILURE)
         IP: 0B in, 0B out
        CPU: 98ms

My impernanence related config:

  systemd.tmpfiles.rules = [
    "d /persist/home/ 1777 root root-"
    "d /persist/home/${username} 0770 ${username} users-"
  ];

  fileSystems."/persist".neededForBoot = true;
  environment.persistence."/persist/system" = {
    hideMounts = true;
    directories = [
      "/var/log"
      "/var/lib/systemd/coredump"
      "/var/lib/bluetooth"
      "/val/lib/nixos"
      "/var/lib/iwd"
    ];
  };

  programs.fuse.userAllowOther = true;
  home-manager.users."${username}" = {
    imports = [inputs.impermanence.nixosModules.home-manager.impermanence];
    home = {
      persistence."/persist/home/${username}" = {
        directories = [
          "Pictures"
          "Documents"
          ".local/share/direnv"
          "nixconf"
          {
            directory = ".local/share/Steam";
            method = "symlink";
          }
        ];
        allowOther = true;
      };
    };
  };

Did you install HM as a NixOs module, right?

I just diagnosed a similar issue, to get the expanded home-manager error log run below:

sudo journalctl -xeu home-manager-unixpariah.service

Should help you narrow down your issue. For me it was a simply font problem unrelated to any changes I had made.

1 Like