From 6e748ec05fa947824319f73e50be18d8f4c1ed2c Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Sat, 21 Oct 2023 22:42:26 +0100 Subject: [PATCH] downloads: improve lo setup --- modules/services/downloads.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/services/downloads.nix b/modules/services/downloads.nix index f2bedd8..73e5548 100644 --- a/modules/services/downloads.nix +++ b/modules/services/downloads.nix @@ -94,6 +94,8 @@ in containers."downloads" = { autoStart = true; ephemeral = true; + + additionalCapabilities = [ "CAP_NET_ADMIN" ]; extraFlags = [ "--network-namespace-path=/run/netns/downloads" ]; bindMounts = { @@ -123,10 +125,11 @@ in systemd.services.setup-loopback = { description = "Setup container loopback adapter."; - - after = [ "network-pre.target" ]; before = [ "network.target" ]; + serviceConfig.Type = "oneshot"; + serviceConfig.RemainAfterExit = true; + script = with pkgs; "${iproute2}/bin/ip link set up lo"; }; networking.hosts = { "127.0.0.1" = builtins.map (x: "${x}.downloads.ts.hillion.co.uk") [ "prowlarr" "sonarr" "radarr" "deluge" ]; };