modularization of all servers donion rings

This commit is contained in:
2024-06-15 00:27:14 -06:00
parent add0490415
commit fbf81f60ce
22 changed files with 618 additions and 521 deletions

View File

@@ -0,0 +1,31 @@
{ lib, config, proxy, ... }: {
options.my.servers.audiobookshelf.enable = lib.mkEnableOption "enable";
config = lib.mkIf config.my.servers.audiobookshelf.enable {
services = {
audiobookshelf = {
enable = true;
group = "piracy";
port = 5687;
};
nginx = {
enable = true;
virtualHosts."audiobooks.${config.my.domain}" = proxy {
"/" = {
proxyPass = "http://${config.my.localhost}:${
toString config.services.audiobookshelf.port
}";
extraConfig = ''
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_redirect http:// https://;
'';
};
};
};
};
};
}