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

42 lines
1 KiB
Nix
Raw Normal View History

2023-04-18 14:03:31 +00:00
{ pkgs, ... }:
2023-04-15 19:40:53 +00:00
{
2023-04-18 14:03:31 +00:00
# The nix-provided options force a sabnzbd-user to a certain degree
2023-04-15 19:40:53 +00:00
systemd.services.sabnzbd = {
2023-04-18 14:03:31 +00:00
description = "sabnzbd server";
2023-04-15 19:40:53 +00:00
bindsTo = [ "wg.service" ];
2023-04-18 14:03:31 +00:00
after = [ "wg.service" ];
wantedBy = [ "multi-user.target" ];
2023-04-15 19:40:53 +00:00
serviceConfig = {
2023-04-18 14:03:31 +00:00
Type = "forking";
GuessMainPID = "no";
User = "media_user";
Group = "media_group";
2023-04-15 19:40:53 +00:00
NetworkNamespacePath = "/var/run/netns/wg";
2023-04-19 06:04:32 +00:00
BindReadOnlyPaths = [
"/etc/netns/wg/resolv.conf:/etc/resolv.conf:norbind"
"/etc/netns/wg/nsswitch.conf:/etc/nsswitch.conf:norbind"
];
2023-04-18 14:03:31 +00:00
ExecStart = "${pkgs.sabnzbd}/bin/sabnzbd -d -f /var/lib/sabnzbd/sabnzbd.ini";
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
};
};
}