diff --git a/nixos/vms/config.nix b/nixos/vms/config.nix index cae926d..6be8a44 100644 --- a/nixos/vms/config.nix +++ b/nixos/vms/config.nix @@ -231,7 +231,7 @@ let in lib.optionalAttrs (cfg.enable) { "vm.vmix@${vmCfg.name}" = rec { - bindsTo = [ "net.vmix@${spaceName}.target" "macvtaps.vm.vmix@${vmCfg.name}.service" ]; + bindsTo = [ "net.vmix@${spaceName}.target" ] ++ lib.optional (allMacvtaps != []) "macvtaps.vm.vmix@${vmCfg.name}.service"; unitConfig.JoinsNamespaceOf = "ns.net.vmix@${spaceName}.service"; after = bindsTo; path = with pkgs; [ iproute2 qemu gawk coreutils ]; @@ -248,9 +248,9 @@ let ProtectSystem = lib.mkForce false; SupplementaryGroups = [ "kvm" ]; }; - wantedBy = lib.mkIf vmCfg.autostart [ "multi-user.target" ]; + wantedBy = lib.mkIf vmCfg.autostart [ "multi-user.target" ]; }; - + } // lib.optionalAttrs (allMacvtaps != []) { "macvtaps.vm.vmix@${vmCfg.name}" = rec { bindsTo = [ "net.vmix@${spaceName}.target" ]; after = bindsTo;