From b37897576902f5d66b5b2ba5d445d9466545b556 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Mon, 5 Jun 2023 03:02:26 +0200 Subject: [PATCH] sonarr: port to vhost --- hosts/architect/sonarr.nix | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/hosts/architect/sonarr.nix b/hosts/architect/sonarr.nix index 42874e8..acebe43 100644 --- a/hosts/architect/sonarr.nix +++ b/hosts/architect/sonarr.nix @@ -2,35 +2,21 @@ let domain = "htson.giugl.io"; - auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block; - - utilities = import ./utilities.nix { inherit lib config; }; - inherit (utilities) architectInterfaceAddress; in { - services = { - sonarr = { - enable = true; - group = "media"; - }; + services.sonarr = { + enable = true; + group = "media"; + }; + + architect.vhost.${domain} = { + dnsInterfaces = [ "tailscale" "wireguard" ]; - nginx.virtualHosts.${domain} = { - forceSSL = true; - enableACME = true; - locations."/" = { - proxyPass = "http://127.0.0.1:8989"; - extraConfig = auth_block { - access_role = "sonarr"; - }; - }; + locations."/" = { + port = 6969; + allowLan = true; }; }; - - networking.extraHosts = '' - ${architectInterfaceAddress "lan"} ${domain} - ${architectInterfaceAddress "wireguard"} ${domain} - ${architectInterfaceAddress "tailscale"} ${domain} - ''; - + users.groups.media.members = [ "sonarr" ]; }