2019-09-25 13:41:44 +00:00
|
|
|
{ pkgs, config, ... }:
|
|
|
|
let
|
2019-09-25 13:11:14 +00:00
|
|
|
pkg = pkgs.callPackage ./sickgear.nix {};
|
2019-09-25 13:41:44 +00:00
|
|
|
external-ip = config.krebs.build.host.nets.internet.ip4.addr;
|
2019-09-25 13:11:14 +00:00
|
|
|
in {
|
2019-09-25 13:41:44 +00:00
|
|
|
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" ];
|
2019-09-25 13:11:14 +00:00
|
|
|
}
|