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 =
|
boot.loader.grub.devices =
|
||||||
(map (diskName: zfsRoot.devNodes + diskName) zfsRoot.bootDevices);
|
(map (diskName: zfsRoot.devNodes + diskName) zfsRoot.bootDevices);
|
||||||
boot.initrd.postDeviceCommands = ''
|
boot.initrd.postDeviceCommands = ''
|
||||||
zpool import -Nf rpool
|
if ! grep -q zfs_no_rollback /proc/cmdline; then
|
||||||
zfs rollback -r rpool/nixos/empty@start
|
zpool import -N rpool
|
||||||
zpool export -a
|
zfs rollback -r rpool/nixos/empty@start
|
||||||
|
zpool export -a
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user