NixOS Root on ZFS: add escape hatch for zfs rollback
Signed-off-by: Maurice Zhou <ja@apvc.uk>
This commit is contained in:
committed by
George Melikov
parent
b3180fd225
commit
3a93793b53
@@ -244,9 +244,11 @@ in {
|
||||
boot.loader.grub.devices =
|
||||
(map (diskName: zfsRoot.devNodes + diskName) zfsRoot.bootDevices);
|
||||
boot.initrd.postDeviceCommands = ''
|
||||
zpool import -Nf rpool
|
||||
if ! grep -q zfs_no_rollback /proc/cmdline; then
|
||||
zpool import -N rpool
|
||||
zfs rollback -r rpool/nixos/empty@start
|
||||
zpool export -a
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user