Skip to content

Commit

Permalink
nixos-modules/host: fix assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
astro committed Jun 7, 2023
1 parent ef1c2d0 commit 5315567
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos-modules/host.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ in
config = lib.mkIf config.microvm.host.enable {
assertions = lib.concatMap (vmName: [
{
assertion = (config.microvm.vms.${vmName}.flake != null) != (config.microvm.vms.${vmName}.config != null);
assertion = config.microvm.vms.${vmName}.config != null -> config.microvm.vms.${vmName}.flake == null;
message = "vm ${vmName}: Fully-declarative VMs cannot also set a flake!";
}
{
assertion = (config.microvm.vms.${vmName}.updateFlake != null) != (config.microvm.vms.${vmName}.config != null);
assertion = config.microvm.vms.${vmName}.config != null -> config.microvm.vms.${vmName}.updateFlake == null;
message = "vm ${vmName}: Fully-declarative VMs cannot set a updateFlake!";
}
]) (builtins.attrNames config.microvm.vms);
Expand Down

0 comments on commit 5315567

Please sign in to comment.