From e7d306d0c2f650827412ba545922a76ce8d24f10 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 25 Sep 2019 15:41:44 +0200 Subject: ma sickbeard: use correct external ip --- makefu/2configs/sickbeard/default.nix | 37 +++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/makefu/2configs/sickbeard/default.nix b/makefu/2configs/sickbeard/default.nix index 629558b89..49e65f091 100644 --- a/makefu/2configs/sickbeard/default.nix +++ b/makefu/2configs/sickbeard/default.nix @@ -1,20 +1,23 @@ -{ }: -{ services.sickbeard = let +{ pkgs, config, ... }: +let pkg = pkgs.callPackage ./sickgear.nix {}; + external-ip = config.krebs.build.host.nets.internet.ip4.addr; in { - enable = true; - package = pkg; - user = "sickbeard"; - group = "download"; - port = 8280; -}; -services.nginx.virtualHosts."sick.makefu.r" = { - locations."/".proxyPass = http://localhost:8280; - extraConfig = '' - if ( $server_addr = "${external-ip}" ) { - return 403; + services.sickbeard = + { + enable = true; + package = pkg; + user = "sickbeard"; + group = "download"; + port = 8280; + }; + services.nginx.virtualHosts."sick.makefu.r" = { + locations."/".proxyPass = http://localhost:8280; + extraConfig = '' + if ( $server_addr = "${external-ip}" ) { + return 403; + } + ''; + }; + users.users.sickbeard.extraGroups = [ "nginx" ]; } - ''; -}; -users.users.sickbeard.extraGroups = [ "nginx" ]; - } -- cgit v1.2.3