diff --git a/machines/modules/malobeo/microvm_host.nix b/machines/modules/malobeo/microvm_host.nix index fc1c816..d7cdc55 100644 --- a/machines/modules/malobeo/microvm_host.nix +++ b/machines/modules/malobeo/microvm_host.nix @@ -1,9 +1,10 @@ -{ config, lib, options, pkgs, ... }: +{ config, self, lib, inputs, options, pkgs, ... }: with lib; let cfg = config.services.malobeo.microvm; + hostsEmpty = length cfg.deployHosts == 0; in { options = { @@ -24,6 +25,11 @@ in }; }; + + imports = [ + inputs.microvm.nixosModules.host + ]; + config = mkIf cfg.enableHostBridge { systemd.network = { @@ -57,10 +63,6 @@ in }; }; - imports = mkIf (lib.length cfg.deployHosts != 0) [ - inputs.microvm.nixosModules.host - ]; - microvm.autostart = cfg.deployHosts; microvm.vms = let @@ -68,12 +70,11 @@ in mapperFunc = name: { inherit name; value = { # Host build-time reference to where the MicroVM NixOS is defined # under nixosConfigurations - flake = self; + flake = inputs.malobeo; # Specify from where to let `microvm -u` update later on updateFlake = "git+https://git.dynamicdiscord.de/kalipso/infrastructure?ref=microvm"; }; }; in - mkIf (lib.length cfg.deployHosts != 0) builtins.listToAttrs (map mapperFunc cfg.deployHosts); }; }