diff --git a/modules/nixos/common/incus.nix b/modules/nixos/common/incus.nix index 8d5132e..14f38a9 100644 --- a/modules/nixos/common/incus.nix +++ b/modules/nixos/common/incus.nix @@ -1,34 +1,31 @@ { - - systemd.network = { - enable = true; - networks."50-eth0" = { - - matchConfig.Name = "eth0"; - networkConfig = { - DHCP = "ipv4"; - IPv6AcceptRA = true; + lib, + config, + pkgs, + ... +}: +{ + options.iscontainer.enable = lib.mkEnableOption "iscontainer" // { + default = true; + }; + config = lib.mkIf config.iscontainer.enable { + systemd.network = { + enable = true; + networks."50-eth0" = { + matchConfig.Name = "eth0"; + networkConfig = { + DHCP = "ipv4"; + IPv6AcceptRA = true; + }; + linkConfig.RequiredForOnline = "routable"; }; - linkConfig.RequiredForOnline = "routable"; + }; + + networking = { + firewall.enable = false; + dhcpcd.enable = false; + useDHCP = false; + useHostResolvConf = false; }; }; - - networking = { - # firewall = { - firewall.enable = false; - # interfaces = { - # ygg0 = { - # allowedTCPPorts = [ 22 ]; - # allowedUDPPorts = [ ]; - # }; - # }; - - # # Default deny policy for all interfaces (including ygg0) - # allowedTCPPorts = [ ]; - # allowedUDPPorts = [ ]; - # }; - dhcpcd.enable = false; - useDHCP = false; - useHostResolvConf = false; - }; }