44 lines
740 B
Nix
44 lines
740 B
Nix
|
{
|
||
|
name = "Sonarr";
|
||
|
description = ''
|
||
|
Sonarr PVR
|
||
|
'';
|
||
|
|
||
|
traefikRoutes =
|
||
|
{
|
||
|
hostname,
|
||
|
config,
|
||
|
...
|
||
|
}:
|
||
|
[
|
||
|
{
|
||
|
name = "${hostname}-sonarr";
|
||
|
rule = "Host(`${config.sonarr.domain}`)";
|
||
|
target = "http://${hostname}.lan:8989";
|
||
|
|
||
|
}
|
||
|
];
|
||
|
|
||
|
nixosModules =
|
||
|
{ 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 = { };
|
||
|
};
|
||
|
};
|
||
|
}
|