changed zfs mountpoints more, setup self cleaning fs root

This commit is contained in:
Gerg-L 2023-03-12 02:21:01 +00:00
parent 2cf332631b
commit 01851cab86
4 changed files with 28 additions and 15 deletions

View file

@ -0,0 +1,18 @@
_: {lib, ...}: {
systemd.tmpfiles.rules = [
"d /mnt - - - - -"
"L+ /etc/ssh/ssh_host_ed25519_key - - - - /persist/ssh/ssh_host_ed25519_key"
"L+ /etc/ssh/ssh_host_ed25519_key.pub - - - - /persist/ssh/ssh_host_ed25519_key.pub"
"L+ /etc/nixos - - - - /persist/nixos"
];
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs snapshot destroy rpool/root@prev
zfs snapshot destroy rpool/var@prev
zfs snapshot create rpool/root@prev
zfs snapshot create rpool/var@prev
zfs rollback -r rpool/root@empty
zfs rollback -r rpool/var@empty
'';
}