I’m trying to figure out how to set up a Nix system with tmpfs as / and /home, ZFS for the persistent storage, the Impermanence module for managing persistent files, and a Flake-based config.
It’s mostly working, but my user’s home directory doesn’t get created even though I have users.users.eufalconimorph.createHome = true;
.
In configuration.nix
:
users = {
mutableUsers = false;
users = {
root.hashedPassword = "!"; # Disable root login
eufalconimorph = {
isNormalUser = true;
description = "Eufalconimorph";
home = "/home/eufalconimorph";
createHome = true;
passwordFile = "/persist/etc/users/eufalconimorph";
extraGroups = [ "wheel" "networkmanager" "audio" "dialout" "docker" "dumpcap" ];
};
};
};
Relevant bit (I think) of hardware-configuration.nix
:
fileSystems."/home" =
{ device = "tmpfs";
fsType = "tmpfs";
options = [ "defaults" "size=2G" "mode=755" ];
};
fileSystems."/home/persist" =
{ device = "rpool/safe/home";
fsType = "zfs";
};
And then in home.nix
I set up directories to persist with `home.persistence.“/home/persist/eufalconimorph” = { # stuff };
At login, /home/eufalconimorph
doesn’t get created. Graphical login fails, unless I login manually to a terminal & make the directory (and change owner). Home-manager fails to start at boot (probably because there’s no home directory).
Edit: I could (of course) add commands to make & change owner of the directory in boot.initrd.postMountCommands
, but that seems like a nasty hack.
I would appreciate any advice.