diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2024-09-29 19:56:08 +0200 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2024-10-27 19:08:46 +0100 |
| commit | 491c4bf6b4596b486b12724e9124a854cc7abc26 (patch) | |
| tree | 3911453e589959da652a1d5f62e5966b05f1643e /config/networking/services/igmpproxy.nix | |
| parent | 072ad00164e98823691e7da1cdd07ac368391c38 (diff) | |
migrate hostapd config
Diffstat (limited to 'config/networking/services/igmpproxy.nix')
| -rw-r--r-- | config/networking/services/igmpproxy.nix | 31 |
1 files changed, 18 insertions, 13 deletions
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}"; }; } |
