From a48d057700c636666a5e835cbcb0b667848008c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 15 Mar 2024 09:13:05 +0100 Subject: nixos: rework configurations management --- nixos/configurations/adm-omnia.nix | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 nixos/configurations/adm-omnia.nix (limited to 'nixos/configurations/adm-omnia.nix') diff --git a/nixos/configurations/adm-omnia.nix b/nixos/configurations/adm-omnia.nix new file mode 100644 index 0000000..3f857ee --- /dev/null +++ b/nixos/configurations/adm-omnia.nix @@ -0,0 +1,82 @@ +{config, ...}: { + turris.board = "omnia"; + + cynerd = { + router = { + enable = true; + wan = "pppoe-wan"; + lanIP = config.cynerd.hosts.adm.omnia; + }; + wifiAP.adm = { + enable = true; + ar9287.interface = "wlp3s0"; + qca988x.interface = "wlp2s0"; + }; + openvpn.oldpersonal = false; + monitoring.speedtest = true; + }; + + networking.useDHCP = false; + systemd.network = { + networks = { + "end2" = { + matchConfig.Name = "end2"; + #networkConfig = { + # DHCP = "ipv6"; + # IPv6AcceptRA = "yes"; + # DHCPPrefixDelegation = "yes"; + #}; + #dhcpPrefixDelegationConfig = { + # UplinkInterface = ":self"; + # SubnetId = 0; + # Announce = "no"; + #}; + linkConfig.RequiredForOnline = "routable"; + }; + "lan-brlan" = { + matchConfig.Name = "lan[1-4]"; + networkConfig.Bridge = "brlan"; + bridgeVLANs = [ + { + bridgeVLANConfig = { + EgressUntagged = 1; + PVID = 1; + }; + } + {bridgeVLANConfig.VLAN = 2;} + ]; + }; + "lan0-guest" = { + matchConfig.Name = "lan0"; + networkConfig.Bridge = "brlan"; + bridgeVLANs = [ + { + bridgeVLANConfig = { + EgressUntagged = 2; + PVID = 2; + }; + } + ]; + }; + }; + }; + + services.pppd = { + enable = true; + peers."wan".config = '' + plugin pppoe.so end2 + ifname pppoe-wan + lcp-echo-interval 1 + lcp-echo-failure 5 + lcp-echo-adaptive + +ipv6 + defaultroute + defaultroute6 + usepeerdns + maxfail 1 + user O2 + password 02 + ''; + }; + systemd.services."pppd-wan".after = ["sys-subsystem-net-devices-end2.device"]; +} -- cgit v1.2.3