added assertion

This commit is contained in:
Leyla Becker 2024-12-13 21:40:47 -06:00
parent 6b1eaa7308
commit b6f1704af3

View file

@ -5,7 +5,6 @@
}: { }: {
options.host.impermanence.enable = lib.mkEnableOption "are we going to use impermanence on this device"; options.host.impermanence.enable = lib.mkEnableOption "are we going to use impermanence on this device";
# TODO: validate that config.host.storage.enable is enabled
config = lib.mkMerge [ config = lib.mkMerge [
{ {
assertions = [ assertions = [
@ -19,6 +18,13 @@
} }
( (
lib.mkIf config.host.impermanence.enable { lib.mkIf config.host.impermanence.enable {
assertions = [
{
assertion = config.host.impermanence.enable && config.host.storage.enable;
message = "Impermanence can not be used without managed host storage.";
}
];
boot.initrd.postResumeCommands = lib.mkAfter '' boot.initrd.postResumeCommands = lib.mkAfter ''
zfs rollback -r rpool/local/system/root@blank zfs rollback -r rpool/local/system/root@blank
1 ''; 1 '';