feat: migrate sonarr to new modular service structure

This commit is contained in:
Giulio De Pasquale (aider) 2025-04-26 16:50:09 +01:00
parent 5601a2cab0
commit 296609fdfb
2 changed files with 38 additions and 0 deletions

View File

@ -3,5 +3,6 @@
./gitea
./immich
./radarr
./sonarr
];
}

View File

@ -0,0 +1,37 @@
{ config, lib, pkgs, ... }:
let
inherit (lib) mkIf;
cfg = config.pepe.services.sonarr;
in
{
options.pepe.services.sonarr = with lib; {
enable = mkEnableOption "Enable sonarr";
package = mkPackageOption pkgs "sonarr" { };
domain = mkOption {
type = types.str;
default = null;
};
};
config = mkIf cfg.enable {
services.sonarr = {
enable = true;
package = cfg.package;
};
architect.vhost.${cfg.domain} = with config.architect.networks; {
dnsInterfaces = [ "tailscale" "lan" ];
locations."/" = {
port = 8989;
allowLan = true;
allow = [
tailscale.net
];
};
};
pepe.core.media.groupMembers = mkIf config.pepe.core.media.enable [ config.services.sonarr.group ];
};
}