dotfiles/system/nixos/sabnzbd.nix

56 lines
1.2 KiB
Nix
Raw Normal View History

2023-07-16 22:17:50 +00:00
{ lib, ... }:
2023-04-15 19:40:53 +00:00
{
2023-05-20 11:15:01 +00:00
systemd.tmpfiles.rules = [
2023-05-20 22:50:04 +00:00
"d /var/lib/sabnzbd 0750 media_user media_group"
2023-05-20 11:15:01 +00:00
];
2023-05-24 11:02:56 +00:00
virtualisation.oci-containers.containers.sabnzbd = {
image = "lscr.io/linuxserver/sabnzbd:latest";
ports = [ "192.168.42.2:8080:8080" ];
environment = {
"PUID" = "1001";
"PGID" = "2001";
"TZ" = "Etc/UTC";
};
volumes = [
"/var/lib/sabnzbd:/config"
"/mnt/downloads:/mnt/downloads"
];
extraOptions = [
"--network=ns:/var/run/netns/wg"
"--label=com.centurylinklabs.watchtower.enable=true"
"--label=io.containers.autoupdate=registry"
];
};
systemd.services.podman-sabnzbd =
let
2023-05-24 11:02:56 +00:00
mounts = [
"mnt-downloads.mount"
];
in
{
2023-05-24 11:02:56 +00:00
requires = lib.mkAfter mounts;
bindsTo = [ "wg.service" ];
2023-05-24 11:02:56 +00:00
after = lib.mkForce ([ "wg.service" ] ++ mounts);
2023-04-15 19:40:53 +00:00
};
services.nginx.virtualHosts."sabnzbd.internal.kempkens.network" = {
quic = true;
http3 = true;
onlySSL = true;
useACMEHost = "internal.kempkens.network";
extraConfig = ''
client_max_body_size 32m;
'';
locations."/" = {
recommendedProxySettings = true;
proxyPass = "http://192.168.42.2:8080";
2023-04-15 19:40:53 +00:00
};
};
}