Open collinarnett opened 2 weeks ago
Hi. I also started using impermanence
with zfs
not too long ago. When I was looking for a non-lts kernel for my system that would also be compatible with zfs
, I came across https://github.com/chaotic-cx/nyx. This repo also has a great solution for your purposes:
https://github.com/chaotic-cx/nyx/blob/main/modules/nixos/zfs-impermanence-on-shutdown.nix
kernel+zfs definition in my cfg:
https://github.com/name-snrl/nixos-configuration/blob/b3d3366d6c2f446b45154ad9d614114f94be6497/modules/nixos/profiles/desktop/default.nix#L9 https://github.com/name-snrl/nixos-configuration/blob/b3d3366d6c2f446b45154ad9d614114f94be6497/modules/nixos/profiles/zfs.nix#L81
Problem
I am new to using impermanence and I observed the following error with the
create-needed-for-boot-dirs
serviceConfiguration
I am using disko and zfs with native encryption to setup my disks. Given that I am using native encryption I cannot use
postDeviceCommands
with impermanence because my drives must be first unencrypted to rollback. Instead ofpostDeviceCommands
I am usinginitrd.systemd
. My service is defined below.As you can see I also added after and wants to
create-needed-for-boot-dirs
in case the rollback service was conflicting withcreate-needed-for-boot-dirs
's ability to umount.Here is my impermanence configuration:
It might also be relevant to show how my zfs datasets are defined:
My entire machine config can be found here https://github.com/collinarnett/brew/tree/main/hosts/azathoth
Attempted fixes
As I eluded to earlier, I tried to make sure that
create-needed-for-boot-dirs
doesn't conflict with the rollback service but I still have the same error. I also found this commit where the author explainsThis seems to imply that the order of unmounting matters but I'm not enough of an expert to determine a fix.