aboutsummaryrefslogtreecommitdiff
path: root/hosts/laurel/servarr.nix
blob: cc225c143e94746b54d3022ed2ec83b21f652ecc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{ self, config, lib, pkgs, ... }:

{
  imports = [ ];

  nixpkgs.overlays = with self.overlays; [
    flaresolverr
  ];

  users.groups."torrent".members = [
    "op"
    "sonarr"
    "radarr"
    "bazarr"
    "jackett"
    "lidarr"
    "jellyfin"
    "transmission"
  ];
  users.users.torrent = {
    isNormalUser = true;
    extraGroups = [ "wheel" "tty" ];
  };
  services.transmission = {
    enable = true;
    openFirewall = true;
    openRPCPort = true;
    user = "torrent";
    settings = {
      download-dir = "/torrents";
      incomplete-dir = "/.incomplete";
      rpc-bind-address = "0.0.0.0";
      rpc-whitelist = "127.0.0.1,10.0.0.1,192.168.*.*,100.64.*.*";
    };
  };
  services.nginx.virtualHosts."torrent.${config.networking.hostName}" = {
    listen = [{ port = 80; addr = "0.0.0.0"; }];
    locations."/" = {
      proxyPass = "http://127.0.0.1:9091";
    };
  };

  services.sonarr = {
    enable = true;
    openFirewall = true;
    group = "torrent";
  };
  services.nginx.virtualHosts."sonarr.${config.networking.hostName}" = {
    listen = [{ port = 80; addr = "0.0.0.0"; }];
    locations."/" = {
      proxyPass = "http://127.0.0.1:8989";
    };
  };

  services.radarr = {
    enable = true;
    openFirewall = true;
    group = "torrent";
  };
  services.nginx.virtualHosts."radarr.${config.networking.hostName}" = {
    listen = [{ port = 80; addr = "0.0.0.0"; }];
    locations."/" = {
      proxyPass = "http://127.0.0.1:7878";
    };
  };

  services.bazarr = {
    enable = true;
    openFirewall = true;
    group = "torrent";
  };
  services.nginx.virtualHosts."bazarr.${config.networking.hostName}" = {
    listen = [{ port = 80; addr = "0.0.0.0"; }];
    locations."/" = {
      proxyPass = "http://127.0.0.1:6767";
    };
  };

  services.jackett = {
    enable = true;
    openFirewall = true;
    group = "torrent";
  };
  services.nginx.virtualHosts."jackett.${config.networking.hostName}" = {
    listen = [{ port = 80; addr = "0.0.0.0"; }];
    locations."/" = {
      proxyPass = "http://127.0.0.1:9117";
    };
  };

  services.lidarr = {
    enable = true;
    openFirewall = true;
    group = "torrent";
  };
  services.nginx.virtualHosts."lidarr.${config.networking.hostName}" = {
    listen = [{ port = 80; addr = "0.0.0.0"; }];
    locations."/" = {
      proxyPass = "http://127.0.0.1:8686";
    };
  };

  services.flaresolverr.enable = true;

}