[microvm] Fix conditionals within module

finally i hope....
This commit is contained in:
2024-11-21 15:25:57 +01:00
parent bdd13a204f
commit 84fef37dc7

View File

@@ -29,8 +29,8 @@ in
inputs.microvm.nixosModules.host
];
config = {
systemd.network = mkIf cfg.enableHostBridge {
config = mkIf cfg.enableHostBridge {
systemd.network = {
enable = true;
# create a bride device that all the microvms will be connected to
netdevs."10-microvm".netdevConfig = {
@@ -54,16 +54,13 @@ in
} ];
};
} // mkIf (!hostEmpty) {
# connect the vms to the bridge
networks."11-microvm" = {
matchConfig.Name = "vm-*";
networkConfig.Bridge = "microvm";
};
};
};
microvm.autostart = cfg.deployHosts;
microvm.vms =
let
# Map the values to each hostname to then generate a Attrs using listToAttrs