config/roles/sonarr.nix

46 lines
790 B
Nix
Raw Normal View History

2024-12-26 17:22:00 +01:00
{
name = "Sonarr";
description = ''
Sonarr PVR
'';
traefikRoutes =
{
2025-02-03 17:05:55 +01:00
host,
2024-12-26 17:22:00 +01:00
...
}:
2025-02-03 17:05:55 +01:00
let
hostname = host.hostname;
config = host.config.sonarr;
in
2024-12-26 17:22:00 +01:00
[
{
name = "${hostname}-sonarr";
2025-02-03 17:05:55 +01:00
rule = "Host(`${config.domain}`)";
target = "http://${host.ip}:8989";
2024-12-26 17:22:00 +01:00
}
];
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 = { };
};
};
}