From c014ef4360ebc9fe23d5abf253141f44a94160ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 20 Feb 2024 21:34:43 +0100 Subject: nixos: merge router to normal modules --- nixos/routers/switch.nix | 65 ------------------------------------------------ 1 file changed, 65 deletions(-) delete mode 100644 nixos/routers/switch.nix (limited to 'nixos/routers/switch.nix') diff --git a/nixos/routers/switch.nix b/nixos/routers/switch.nix deleted file mode 100644 index 16d57bc..0000000 --- a/nixos/routers/switch.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - config, - lib, - ... -}: -with lib; let - cnf = config.cynerd.switch; -in { - options = { - cynerd.switch = { - enable = mkEnableOption "Enable switch support"; - lanAddress = mkOption { - type = types.str; - description = "LAN IP address"; - }; - lanGateway = mkOption { - type = types.str; - description = "LAN IP address of the gateway"; - }; - }; - }; - - config = mkIf cnf.enable { - networking = { - useNetworkd = true; - nftables.enable = true; - }; - - systemd.network = { - netdevs = { - "brlan" = { - netdevConfig = { - Kind = "bridge"; - Name = "brlan"; - }; - extraConfig = '' - [Bridge] - DefaultPVID=none - VLANFiltering=yes - ''; - }; - }; - networks = { - "brlan" = { - matchConfig.Name = "brlan"; - bridgeVLANs = [ - { - bridgeVLANConfig = { - PVID = 1; - EgressUntagged = 1; - }; - } - ]; - networkConfig = { - Address = cnf.lanAddress; - Gateway = cnf.lanGateway; - DNS = "1.1.1.1"; - IPv6AcceptRA = "yes"; - }; - }; - }; - wait-online.anyInterface = true; - }; - }; -} -- cgit v1.2.3