impermanence

This commit is contained in:
2026-06-20 16:42:58 -05:00
parent 49b665abac
commit ecae2c1296
2 changed files with 19 additions and 463 deletions
+19 -4
View File
@@ -185,11 +185,26 @@
];
};
# Rollback root on reboot
boot.initrd.postMountCommands = lib.mkAfter ''
zfs rollback -r zroot/root@blank
'';
boot.zfs.forceImportRoot = false;
# Delete root on reboot
boot.initrd.systemd.services = {
rollback = {
description = "Rollback root zfs dataset to blank snapshot";
wantedBy = [ "initrd.target" ];
before = [ "sysroot.mount" ];
after = [ "zfs-import-zroot.service" ];
path = [ pkgs.zfs ];
unitConfig.DefaultDependencies = "no";
serviceConfig.Type = "oneshot";
script = ''
zfs rollback -r zroot/root@blank
echo "blank rollback complete" > /dev/kmsg
'';
};
};
networking = {
hostName = meta.hostname;
hostId = meta.hostId;