Closed Erethon closed 8 months ago
I think I ran into something very similar, although my setup is a little bit different: I have my entire /home
on tmpfs... but it shouldn't really matter. In any case, what you want is neededForBoot = true
for the /home
mount. As far as I see, that should fix your issue.
If it doesn't, then if you follow what I did, and put /home
on tmpfs, and create your user directory via boot.initrd.postMountCommands
, that definitely works, I'm using that. =)
(But I'm also relatively new to NixOS, so your mileage may vary)
In any case, what you want is
neededForBoot = true
for the/home
mount. As far as I see, that should fix your issue.
You're correct, that fixed the issue, thank you!
It's documented too, but for some reason I failed to properly parse it. The wording made me think it would have the opposite effect of what it did.
Hello, let me preface this by saying that I'm completely new to NixOS, so I might have misunderstood how impermanence is supposed to work.
On a fresh NixOS install (23.05), I've got
/home/dgrig
mounted as a tmpfs via:Then via impermanence with the nixos module I've setup some directories and files:
Running this via
nixos-rebuild switch
works fine, but when rebooting the system only the directories are present and not the files.I've tracked this down to the order we run the systemd jobs. We first run the
persist--persistent-X.service
s, so thefiles
get mounted, for example/home/dgrig/.zshrc
. After that thesystemd-fstab-generator
mounts run and we get/home/dgrig
mounted, which "removes/overwrites" thefiles
, Thedirectories
are also mounted at the same time. Here's a SVG showing the systemd boot order of the system.So, is this a PEBKAC? Am I using the nixos module wrong or should we have a setting for which order to mount things?