Open Nikola-Milovic opened 3 weeks ago
I'm thinking it has something to do with the fact that the /persist/home/*
mounts all map to the /home
subvol, which gets erased on boot. It's different than the etc mounts because they all map to /persist/*
, which isn't erased.
To point it out in the mount
output:
/dev/sda2 on /etc/machine-id type btrfs (rw,noatime,compress=zstd:3,space_cache=v2,subvolid=259,subvol=/persist)
is mapping /persist/etc/machine-id -> /etc/machine-id
/persist/home/nikola/.dotfiles on /home/nikola/.dotfiles type fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100,default_permissions,allow_other)
is mapping /persist/home/nikola/.dotfiles -> /home/nikola/.dotfiles
(I could very well be wrong here, it's just the explanation that makes sense to me, but please verify this)
I tried a very similar setup recently with a separate /home
subvolume, and I had the same issue as you.
I couldn't figure out a solution so I decided to ditch the /home
subvolume and just use the setup suggested in the readme with both the system and home modules. It worked with no issues.
If having a /home
subvol is not super critical, and you can't figure out a solution, I'd suggest you just don't use one. I decided there wasn't really any benefit for me having one anyways, since I'd be using the same options as my /root
subvol, and as far as backups go, I'd just backup the whole /persistent
subvol.
If you do figure out something that works though, please do let me know!
@zackattackz Thanks for the comment, are you using home manager impermanence module for home backup or are you using the nixos module?
I wanted to have them separate just for the fact that it would be nice to have opt-in impermanence for home :/
I'm using both modules, I just gave up on having a /home
subvol. I'll share some of my config and explain below :)
My configs are still changing a lot so I apologize in advance if any of it is confusing lol.
Also note that I've designed it around multiple machines, so it might add an extra layer of complexity you don't need if you're just concerned with one machine. But the overall idea should still work.
Here I have the nixos module. Note that the only impermanence directories/files I have set up are ones that aren't specific to anything but the barebones nixos stuff.
For any other nixos modules I'm using which I want to add it's directories to impermanence, I use my impermanence.extra*
options. For example, here is for bluetooth.
The extraUser*
options are used for adding impermanence dirs/files for ALL available users for a given nixos module. For example, here is steam. This is useful for nixos modules that don't have a home-manager counterpart, but need to persist home related files.
Now here is the impermanence home module. It's useful for only a specified user via the cfg.user
option, so there's no need for extraUser*
options like the nixos one. It still has extraDirs
and extraFiles
though, for instance it is used with neovim.
Everything ends up in /persistent
, and I just back that up incrementally as one whole. It would be nice to have seperate subvols to backup the /persistent/home
files separately from the rest, but it's not critical for me. Everything else is reproducible via the flake, so I only need to backup the /persistent
anyways, so the separation between "home" stuff and "system" stuff doesn't really matter that much backup-wise.
Oh and also here is the initrd hook I use, which is I believe just the same as the readme.
I hope this is helpful, open to answer any questions.
Hello everyone, this is 100% my error, but I am having a hard time understanding where exactly I am I wrong. The issue seems to be that
home.persistance
results in empty specified directories, whileenvironment.persistance
works as expected.My dotfiles are, most relevant is the home-manager and the nixos impermanence modules. I am using snowfall hence the organization is specific, but hopefully you can navigate it.
I am using
btrfs
as myfs
and currently this is the service I have, it works, it rollbacks the/
and the/home
but for some reason, the persisted home files are all empty directories. I must've messed up the order or something but have no idea what exactlyMy rollback systemd service
My
home/impermanence/default.nix
And this is the result
But the regular
/persist/etc
for example has the files and it all works properlySo it must be something with the way
home.persistance
differs fromenvironment.persistance
, or I just made some stupid error