1
0
Fork 0
dotfiles/system/nixos/sonarr.nix

59 lines
1.4 KiB
Nix
Raw Normal View History

2023-07-16 22:17:50 +00:00
{ lib, ... }:
2023-04-15 22:11:15 +00:00
{
2023-05-24 11:02:56 +00:00
virtualisation.oci-containers.containers.sonarr = {
2023-10-08 10:49:01 +00:00
image = "lscr.io/linuxserver/sonarr:develop";
2023-05-24 11:02:56 +00:00
ports = [ "192.168.42.2:8989:8989" ];
environment = {
"PUID" = "1001";
"PGID" = "2001";
"TZ" = "Etc/UTC";
};
volumes = [
"/var/lib/sonarr/.config/NzbDrone:/config"
"/mnt/downloads:/mnt/downloads"
"/mnt/media/TV Shows:/mnt/media/TV Shows"
"/mnt/media/Documentaries:/mnt/media/Documentaries"
"/mnt/media/Anime:/mnt/media/Anime"
];
extraOptions = [
"--network=ns:/var/run/netns/wg"
"--label=com.centurylinklabs.watchtower.enable=true"
"--label=io.containers.autoupdate=registry"
];
2023-04-15 22:11:15 +00:00
};
2023-05-24 11:02:56 +00:00
systemd.services.podman-sonarr =
let
mounts = [
"mnt-media-TV\\x20Shows.mount"
"mnt-media-Documentaries.mount"
"mnt-media-Anime.mount"
"mnt-downloads.mount"
2023-04-19 06:04:32 +00:00
];
in
{
2023-05-24 11:02:56 +00:00
requires = lib.mkAfter mounts;
bindsTo = [ "wg.service" ];
after = lib.mkForce ([ "wg.service" ] ++ mounts);
2023-04-15 22:11:15 +00:00
};
services.nginx.virtualHosts."sonarr.internal.kempkens.network" = {
quic = true;
http3 = true;
onlySSL = true;
useACMEHost = "internal.kempkens.network";
extraConfig = ''
client_max_body_size 32m;
'';
locations."/" = {
2023-04-15 22:32:06 +00:00
recommendedProxySettings = true;
proxyPass = "http://192.168.42.2:8989";
proxyWebsockets = true;
2023-04-15 22:11:15 +00:00
};
};
}