feat: installed bazarr, radarr, and sonarr

This commit is contained in:
Leyla Becker 2025-09-25 19:36:34 -05:00
parent 4d52c58f79
commit f9fe74cc8a
11 changed files with 201 additions and 3 deletions

View file

@ -0,0 +1,6 @@
{...}: {
imports = [
./proxy.nix
./impermanence.nix
];
}

View file

@ -0,0 +1,26 @@
{
lib,
config,
...
}: let
sonarr_data_directory = "/var/lib/sonarr/.config/NzbDrone";
in {
config = lib.mkIf (config.services.sonarr.enable && config.host.impermanence.enable) {
assertions = [
{
assertion = config.services.sonarr.dataDir == sonarr_data_directory;
message = "sonarr data directory does not match persistence";
}
];
environment.persistence."/persist/system/root" = {
directories = [
{
directory = sonarr_data_directory;
user = "sonarr";
group = "sonarr";
}
];
};
};
}

View file

@ -0,0 +1,28 @@
{
lib,
config,
...
}: {
options.services.sonarr = {
subdomain = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
description = "Subdomain for reverse proxy. If null, service will be local only.";
};
extraSubdomains = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = [];
description = "Extra subdomains for reverse proxy.";
};
};
config = lib.mkIf (config.services.sonarr.enable && config.services.sonarr.subdomain != null) {
host.reverse_proxy.subdomains.sonarr = {
subdomain = config.services.sonarr.subdomain;
extraSubdomains = config.services.sonarr.extraSubdomains;
target = "http://127.0.0.1:8989";
websockets.enable = true;
forwardHeaders.enable = true;
};
};
}