diff options
| author | quentin@aristote.fr <quentin@aristote.fr> | 2023-07-19 07:58:50 +0200 |
|---|---|---|
| committer | quentin@aristote.fr <quentin@aristote.fr> | 2023-07-19 08:01:13 +0200 |
| commit | 17d229f3ed3de70e4de74ff6e1a0b9b5b4c58873 (patch) | |
| tree | e1c9982540e70a30645ea2dc644b09481edb8313 /config/networking | |
| parent | 91db0cda030efc8f4c383354d74df6157040caa2 (diff) | |
networking: add -netdev services as dependencies
Diffstat (limited to 'config/networking')
| -rw-r--r-- | config/networking/services/dhcp.nix | 4 | ||||
| -rw-r--r-- | config/networking/services/igmpproxy.nix | 21 |
2 files changed, 17 insertions, 8 deletions
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}"; }; } |
