TODO: test ephemeral root works as expected

This commit is contained in:
2025-04-27 16:05:18 -05:00
parent 3e792a7361
commit 2d53e81605
2 changed files with 16 additions and 11 deletions
+5
View File
@@ -89,6 +89,11 @@ in
]; ];
}; };
# Rollback root on reboot
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r zpool/local/root@blank
'';
networking.hostName = meta.hostname; networking.hostName = meta.hostname;
networking.hostId = meta.hostId; networking.hostId = meta.hostId;
+11 -11
View File
@@ -39,28 +39,28 @@
"com.sun:auto-snapshot" = "false"; "com.sun:auto-snapshot" = "false";
}; };
# what should I be making a snapshot of here?!!!! # what should I be making a snapshot of here?!!!!
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zpool/local/zroot@blank$' || zfs snapshot zpool/local/zroot@blank";
datasets = { datasets = {
"root" = { "local/root" = {
type = "zfs_fs"; type = "zfs_fs";
options.mountpoint = "/"; options.mountpoint = "/";
mountpoint = "/"; mountpoint = "/";
postCreateHook = "zfs list -t snapshot -H -o name | grep -E '^zroot/local/root@blank$' || zfs snapshot zroot/local/root@blank";
}; };
"nix" = { "local/nix" = {
type = "zfs_fs"; type = "zfs_fs";
options.mountpoint = "/local/nix"; options.mountpoint = "/nix";
mountpoint = "/local/nix"; mountpoint = "/nix";
}; };
"home" = { "safe/home" = {
type = "zfs_fs"; type = "zfs_fs";
options.mountpoint = "/safe/home"; options.mountpoint = "/home";
mountpoint = "/safe/home"; mountpoint = "/home";
}; };
"persist" = { "safe/persist" = {
type = "zfs_fs"; type = "zfs_fs";
options.mountpoint = "/safe/persist"; options.mountpoint = "/persist";
mountpoint = "/safe/persist"; mountpoint = "/persist";
}; };
}; };
}; };