From 4dc22160a80b98afb1a47fc49dfd88500befabd9 Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Wed, 19 Apr 2023 08:04:32 +0200 Subject: [PATCH] mediaserver: configure nameserver --- secret/container/additional-media/default.nix | Bin 2221 -> 2384 bytes system/hosts/mediaserver.nix | 10 ---------- system/nixos/radarr.nix | 4 ++++ system/nixos/sabnzbd.nix | 4 ++++ system/nixos/sonarr.nix | 4 ++++ 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/secret/container/additional-media/default.nix b/secret/container/additional-media/default.nix index 4f1b49ef75790153797d0d8cb1e8ed93a58ee817..491f0ad33555a0292a30e7568bfa1c85eec393b7 100644 GIT binary patch literal 2384 zcmV-W39t45M@dveQdv+`059E86l>7SJ!lViKD<61zlc#r1OK=&wcbWOs0`Qpt*UFU zP4{Rc?VI|krwf$Dx}se(K|Y{}O)Z$gDxb;~oo~hiZgF^*b|VGab8ve-skFP7OUcN^ zq$U?mj_9!2#-hYHT>m=hfcB5gL-`j)H~&?(tzY*fz%8%3ga2lBQS^Mm!x|+qA^Ps* zONaMDD2+TymbYMb_b}TiwmOiY5gGc@w3D9^%PO#Ne1v)qwKcutSdKv1@zHO59J>co z`@Dlbzd9!=!|F5?_qYZ&$)g}vmouRIWQq zkqTEmBj~;TPLJK+Gez3KA5uQ*@R^jAdvX7l;WtMGBzGn<;+!qBe4$|LB$U0FR;1ch zXF1$M;rPW|VRKSqRBsDF7mkDL=odv6TMj$m8#;JKJc+sz8JJRkeqv^Ige#4aS9PAc6|=JgTQ z@c31m7Zt*{T9a6W|6QB^AlHNY{ht_;K8R*GkRN%yOkS4oM70z|Vm;x~;PJCl=bfCy z;^BXli0%Ucw9|J%8WcpTTIT#e5@RA53qo(=d{<;&cp;||pJcCl?8;W+;>^Wf276x| z;mNrBln_HPG4@&T%Cq$e(u=J225)H?H^ZOecX*pNTo5EiauYw0rin?Jm3HI10e6dD z%D+TPHQ8K|URE4K8-ULQ*<`>{z>Lne3xJy!YSB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mi)V9IASv99{3tbFZD^ZW4hl~ZE zq7K5sZv2EpBzuJ}Wgk_H$$RcRo28GxbFwVK&R--X~7WAlWhdI;Muc&iu##lp*PrJn}B}cbG-UMo2Q&)j@T2@qD z{9&<4TLw33s2m%Axs=(JiAXP(MJ?yvuuWB1l=?w^K^svp=*X6?s;n^MNm@hkyUN*@ zShWmEaVMNSfr~Iijjt4*Z687eO7dFfwUl3->iWdP52~83(t(5p_`P0S6S*M2y}@l< v3J7I`4K$sk?vGU*Y)EaS=?RptqGNyTV0LRN*V2H%3H1xO%Iyth2_{*$9_>Ts diff --git a/system/hosts/mediaserver.nix b/system/hosts/mediaserver.nix index 6517d7d..5e8f1ab 100644 --- a/system/hosts/mediaserver.nix +++ b/system/hosts/mediaserver.nix @@ -102,16 +102,6 @@ in }; }; - services.resolved.enable = false; - - environment.etc."resolv.conf" = { - mode = "0644"; - text = '' - search lan - nameserver 10.0.0.1 - ''; - }; - services.journald.extraConfig = '' SystemMaxUse=1G ''; diff --git a/system/nixos/radarr.nix b/system/nixos/radarr.nix index e5c96c8..e7cc99a 100644 --- a/system/nixos/radarr.nix +++ b/system/nixos/radarr.nix @@ -14,6 +14,10 @@ serviceConfig = { NetworkNamespacePath = "/var/run/netns/wg"; + BindReadOnlyPaths = [ + "/etc/netns/wg/resolv.conf:/etc/resolv.conf:norbind" + "/etc/netns/wg/nsswitch.conf:/etc/nsswitch.conf:norbind" + ]; }; }; diff --git a/system/nixos/sabnzbd.nix b/system/nixos/sabnzbd.nix index bafaf1b..85b5be3 100644 --- a/system/nixos/sabnzbd.nix +++ b/system/nixos/sabnzbd.nix @@ -14,6 +14,10 @@ User = "media_user"; Group = "media_group"; NetworkNamespacePath = "/var/run/netns/wg"; + BindReadOnlyPaths = [ + "/etc/netns/wg/resolv.conf:/etc/resolv.conf:norbind" + "/etc/netns/wg/nsswitch.conf:/etc/nsswitch.conf:norbind" + ]; ExecStart = "${pkgs.sabnzbd}/bin/sabnzbd -d -f /var/lib/sabnzbd/sabnzbd.ini"; }; }; diff --git a/system/nixos/sonarr.nix b/system/nixos/sonarr.nix index 801664f..4c45fbe 100644 --- a/system/nixos/sonarr.nix +++ b/system/nixos/sonarr.nix @@ -14,6 +14,10 @@ serviceConfig = { NetworkNamespacePath = "/var/run/netns/wg"; + BindReadOnlyPaths = [ + "/etc/netns/wg/resolv.conf:/etc/resolv.conf:norbind" + "/etc/netns/wg/nsswitch.conf:/etc/nsswitch.conf:norbind" + ]; }; };