snowfield/modules/sonarr/default.nix

46 lines
820 B
Nix
Raw Normal View History

{
lib,
pkgs,
config,
...
}:
2021-12-04 13:13:13 +01:00
with lib;
let
2021-12-04 13:13:13 +01:00
cfg = config.luj.sonarr;
port = 8989;
in
{
options.luj.sonarr = {
enable = mkEnableOption "activate sonarr service";
user = mkOption {
type = types.str;
default = "sonarr";
description = "User account under which Sonarr runs.";
};
group = mkOption {
type = types.str;
default = "sonarr";
description = "Group under which Sonarr runs.";
};
2021-12-04 13:13:13 +01:00
nginx.enable = mkEnableOption "activate nginx";
2024-05-23 18:35:05 +02:00
nginx.subdomain = mkOption { type = types.str; };
2021-12-04 13:13:13 +01:00
};
2024-05-23 18:35:05 +02:00
config = mkIf cfg.enable (mkMerge [
{
services.sonarr = {
enable = true;
2025-01-03 00:16:39 +01:00
package = pkgs.sonarr;
2024-03-30 20:58:04 +01:00
inherit (cfg) user group;
2021-12-04 13:13:13 +01:00
};
}
2024-05-23 18:35:05 +02:00
(mkIf cfg.nginx.enable (mkVPNSubdomain cfg.nginx.subdomain port))
]);
2021-12-04 13:13:13 +01:00
}