diff --git a/modules/nixos/networking/default.nix b/modules/nixos/networking/default.nix index 1a53783..49ab34d 100644 --- a/modules/nixos/networking/default.nix +++ b/modules/nixos/networking/default.nix @@ -1,23 +1,32 @@ -_: { - networking = { - hostname = "bridge"; +{ + config, + lib, + ... +}: { + options = { + networking.enable = lib.mkEnableOption "enable networking"; + }; + config = lib.mkIf config.networking.enable { + networking = { + hostname = "bridge"; - networkmanager = { - enable = true; - unmanaged = ["virbr0" "docker0"]; + networkmanager = { + enable = true; + unmanaged = ["virbr0" "docker0"]; + }; + + nftables.enable = true; + + firewall = { + allowedTCPPorts = [80 443]; + trustedInterfaces = ["incusbr0" "virbr0"]; + }; + + extraHosts = '' + 185.199.108.133 raw.githubusercontent.com + ''; + nameservers = ["1.1.1.1" "9.9.9.9"]; + bridges = {incusbr0.interfaces = [];}; }; - - nftables.enable = true; - - firewall = { - allowedTCPPorts = [80 443]; - trustedInterfaces = ["incusbr0" "virbr0"]; - }; - - extraHosts = '' - 185.199.108.133 raw.githubusercontent.com - ''; - nameservers = ["1.1.1.1" "9.9.9.9"]; - bridges = {incusbr0.interfaces = [];}; }; }