NixOS Root on ZFS: add escape hatch for zfs rollback

Signed-off-by: Maurice Zhou <ja@apvc.uk>
This commit is contained in:
Maurice Zhou
2023-02-14 18:03:29 +01:00
committed by George Melikov
parent b3180fd225
commit 3a93793b53

View File

@@ -244,9 +244,11 @@ in {
boot.loader.grub.devices =
(map (diskName: zfsRoot.devNodes + diskName) zfsRoot.bootDevices);
boot.initrd.postDeviceCommands = ''
zpool import -Nf rpool
zfs rollback -r rpool/nixos/empty@start
zpool export -a
if ! grep -q zfs_no_rollback /proc/cmdline; then
zpool import -N rpool
zfs rollback -r rpool/nixos/empty@start
zpool export -a
fi
'';
}