From 17d229f3ed3de70e4de74ff6e1a0b9b5b4c58873 Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Wed, 19 Jul 2023 07:58:50 +0200 Subject: networking: add -netdev services as dependencies --- config/networking/services/dhcp.nix | 4 ++++ config/networking/services/igmpproxy.nix | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) (limited to 'config') diff --git a/config/networking/services/dhcp.nix b/config/networking/services/dhcp.nix index 956416e..1958f28 100644 --- a/config/networking/services/dhcp.nix +++ b/config/networking/services/dhcp.nix @@ -44,4 +44,8 @@ in { }) subnets; }; }; + + systemd.services.kea-dhcp4-server.after = + builtins.map (subnet: "${subnet.interface}-netdev.service") + (with nets; [ wan iot ]); } diff --git a/config/networking/services/igmpproxy.nix b/config/networking/services/igmpproxy.nix index 3d7fb9c..6bfb43b 100644 --- a/config/networking/services/igmpproxy.nix +++ b/config/networking/services/igmpproxy.nix @@ -1,17 +1,22 @@ { config, pkgs, ... }: -let nets = config.personal.networking.networks; - conf = pkgs.writeText "igmpproxy.conf" '' - phyint ${nets.wan.interface} upstream ratelimit 0 threshold 1 - phyint ${nets.iot.interface} downstream ratelimit 0 threshold 1 - phyint ${nets.lan.interface} downstream ratelimit 0 threshold 1 - ''; +let + nets = config.personal.networking.networks; + nets-dependencies = + 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 phyint ${nets.lan.interface} downstream ratelimit 0 threshold 1 + ''; in { systemd.services.igmpproxy = { description = "Multicast router utilizing IGMP forwarding"; wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; + after = [ "network.target" ] ++ nets-dependencies; + requires = nets-dependencies; path = [ pkgs.igmpproxy ]; - script = "igmpproxy -vv -n ${conf}"; + script = "igmpproxy -v -n ${conf}"; }; } -- cgit v1.2.3