summaryrefslogtreecommitdiff
path: root/modules/nixfiles/radarr.nix
blob: 1ed0747e69bf0a2dcd713023099c2eee4d3fcb61 (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
{
  config,
  lib,
  ...
}:
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.fqdn}";
    };
  };

  config = mkIf cfg.enable {
    nixfiles.modules.nginx = {
      enable = true;
      virtualHosts.${cfg.domain}.locations."/".proxyPass = "http://127.0.0.1:7878";
    };

    services.radarr.enable = true;
  };
}