2023-04-13 22:12:24 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
2023-04-13 20:53:38 +00:00
|
|
|
{
|
|
|
|
services.prowlarr = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.prowlarr = {
|
|
|
|
bindsTo = [ "netns@wg.service" ];
|
|
|
|
after = [ "wg.service" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
NetworkNamespacePath = "/var/run/netns/wg";
|
|
|
|
};
|
|
|
|
};
|
2023-04-13 22:12:24 +00:00
|
|
|
|
|
|
|
systemd.services.socat-prowlarr = {
|
|
|
|
description = "socat exposes prowlarr";
|
|
|
|
bindsTo = [ "netns@wg.service" ];
|
|
|
|
after = [ "network.target" "wg.service" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "simple";
|
2023-04-13 22:27:54 +00:00
|
|
|
User = "nobody";
|
2023-04-13 22:12:24 +00:00
|
|
|
NetworkNamespacePath = "/var/run/netns/wg";
|
2023-04-14 11:57:58 +00:00
|
|
|
ExecStart = "${pkgs.socat}/bin/socat -d -d UNIX-LISTEN:/tmp/prowlarr.sock,unlink-early,fork TCP4:127.0.0.1:9696";
|
2023-04-13 22:12:24 +00:00
|
|
|
Restart = "on-failure";
|
|
|
|
};
|
|
|
|
};
|
2023-04-14 15:45:02 +00:00
|
|
|
|
|
|
|
services.nginx.virtualHosts."prowlarr.internal.kempkens.network" = {
|
|
|
|
quic = true;
|
|
|
|
http3 = true;
|
|
|
|
|
|
|
|
onlySSL = true;
|
|
|
|
useACMEHost = "internal.kempkens.network";
|
|
|
|
|
|
|
|
locations."/" = {
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
proxyPass = "http://unix:/tmp/prowlarr.sock";
|
|
|
|
};
|
|
|
|
};
|
2023-04-13 20:53:38 +00:00
|
|
|
}
|