From 491c4bf6b4596b486b12724e9124a854cc7abc26 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Sun, 29 Sep 2024 19:56:08 +0200 Subject: migrate hostapd config --- config/networking/services/igmpproxy.nix | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) (limited to 'config/networking/services/igmpproxy.nix') diff --git a/config/networking/services/igmpproxy.nix b/config/networking/services/igmpproxy.nix index 6999807..d3ac7f3 100644 --- a/config/networking/services/igmpproxy.nix +++ b/config/networking/services/igmpproxy.nix @@ -1,20 +1,25 @@ -{ config, pkgs, ... }: - -let - nets = config.personal.networking.networks; - netdevServices = builtins.map (subnet: "${subnet.interface}-netdev.service") - (with nets; [ wan iot ]); - conf = pkgs.writeText "igmpproxy.conf" '' - phyint ${nets.wan.interface} upstream ratelimit 0 threshold 1 - phyint ${nets.iot.interface} downstream ratelimit 0 threshold 1 - ''; +{ + lib, + pkgs, + ... +}: let + upstream = "wan"; + downstream = ["iot"]; + netdevServices = builtins.map (iface: "${iface}-netdev.service") ([upstream] ++ downstream); + conf = pkgs.writeText "igmpproxy.conf" ('' + phyint ${upstream} upstream ratelimit 0 threshold 1 + '' + + lib.concatMapStrings (iface: '' + phyint ${iface} downstream ratelimit 0 threshold 1 + '') + downstream); in { systemd.services.igmpproxy = { description = "Multicast router utilizing IGMP forwarding"; - wantedBy = [ "multi-user.target" ]; - after = [ "kea-dhcp4-server.service" ] ++ netdevServices; + wantedBy = ["multi-user.target"]; + after = ["kea-dhcp4-server.service"] ++ netdevServices; bindsTo = netdevServices; - path = [ pkgs.igmpproxy ]; + path = [pkgs.igmpproxy]; script = "igmpproxy -v -n ${conf}"; }; } -- cgit v1.2.3