blob: 9e4e13f28cccb6ee9b8a5cf7902d34a0bc0d98e3 (
plain) (
blame)
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
|
{
config,
lib,
libNginx,
...
}:
with lib;
let
cfg = config.nixfiles.modules.radarr;
in
{
options.nixfiles.modules.radarr = {
enable = mkEnableOption "Radarr";
domain = mkOption {
description = "Domain name sans protocol scheme.";
type = with types; str;
default = "radarr.${config.networking.domain}";
};
};
config = mkIf cfg.enable {
ark.directories = [ "/var/lib/radarr" ];
nixfiles.modules.nginx = {
enable = true;
upstreams.radarr.servers."127.0.0.1:7878" = { };
virtualHosts.${cfg.domain} = {
locations."/".proxyPass = "http://radarr";
extraConfig = libNginx.config.internalOnly;
};
};
services.radarr = {
enable = true;
user = "rtorrent";
group = "rtorrent";
};
};
}
|