config/roles/sonarr.nix

43 lines
738 B
Nix
Raw Normal View History

2024-12-26 17:22:00 +01:00
{
name = "Sonarr";
description = ''
Sonarr PVR
'';
traefikRoutes =
{
hostname,
config,
...
}:
[
{
name = "${hostname}-sonarr";
rule = "Host(`${config.sonarr.domain}`)";
target = "http://${hostname}.lan:8989";
}
];
nixosModule =
2024-12-26 17:22:00 +01:00
{ lib, ... }:
{
options.sonarr = {
domain = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
};
config = {
# Enable the sonarr service
services.sonarr = {
enable = true;
openFirewall = true;
group = "media";
};
# Ensure that the media group exists
users.groups.media = { };
};
};
}