summaryrefslogtreecommitdiff
path: root/modules/nixfiles/sonarr.nix
blob: 1b22d636536ca23132ffb2559c373fa08ab74ea1 (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.sonarr;
in {
  options.nixfiles.modules.sonarr = {
    enable = mkEnableOption "Sonarr";

    domain = mkOption {
      description = "Domain name sans protocol scheme.";
      type = with types; str;
      default = "sonarr.${config.networking.fqdn}";
    };
  };

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

    services.sonarr.enable = true;
  };
}