only create macvtaps service when macvtaps are configured
Prevents unnecessary VM restarts on deploy when no macvtaps are used. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5fbdd36107
commit
f997b72f40
1 changed files with 3 additions and 3 deletions
|
|
@ -231,7 +231,7 @@ let
|
||||||
in
|
in
|
||||||
lib.optionalAttrs (cfg.enable) {
|
lib.optionalAttrs (cfg.enable) {
|
||||||
"vm.vmix@${vmCfg.name}" = rec {
|
"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";
|
unitConfig.JoinsNamespaceOf = "ns.net.vmix@${spaceName}.service";
|
||||||
after = bindsTo;
|
after = bindsTo;
|
||||||
path = with pkgs; [ iproute2 qemu gawk coreutils ];
|
path = with pkgs; [ iproute2 qemu gawk coreutils ];
|
||||||
|
|
@ -250,7 +250,7 @@ let
|
||||||
};
|
};
|
||||||
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 {
|
"macvtaps.vm.vmix@${vmCfg.name}" = rec {
|
||||||
bindsTo = [ "net.vmix@${spaceName}.target" ];
|
bindsTo = [ "net.vmix@${spaceName}.target" ];
|
||||||
after = bindsTo;
|
after = bindsTo;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue