Fix rolling back to blank root snapshot on servers

This commit is contained in:
Charlotte Van Petegem 2020-12-11 10:24:07 +01:00
parent e086653694
commit 5ff8902446
No known key found for this signature in database
GPG key ID: 019E764B7184435A
5 changed files with 8 additions and 1 deletions

View file

@ -40,6 +40,9 @@ in
location = "lasting-integrity.vanpetegem.me";
}];
};
rootDataset = lib.mkOption {
example = "rpool/local/root";
};
};
config = lib.mkIf config.chvp.zfs.enable {
@ -50,7 +53,7 @@ in
supportedFilesystems = [ "zfs" ];
zfs.requestEncryptionCredentials = config.chvp.zfs.encrypted;
initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r rpool/local/root@blank
zfs rollback -r ${config.chvp.zfs.rootDataset}@blank
'';
};