homepage: audiobookshelf init
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
{ lib, config, proxy, ... }: {
|
||||
options.my.servers.audiobookshelf.enable = lib.mkEnableOption "enable";
|
||||
{ lib, config, proxy, setup, ... }:
|
||||
let cfg = config.my.servers.audiobookshelf;
|
||||
in {
|
||||
options.my.servers.audiobookshelf =
|
||||
setup.mkServerOptions "audiobookshelf" "audiobooks" 5687;
|
||||
config = lib.mkIf config.my.servers.audiobookshelf.enable {
|
||||
services = {
|
||||
audiobookshelf = {
|
||||
enable = true;
|
||||
group = "piracy";
|
||||
port = 5687;
|
||||
port = cfg.port;
|
||||
};
|
||||
nginx = {
|
||||
enable = true;
|
||||
virtualHosts."audiobooks.${config.my.domain}" = proxy {
|
||||
virtualHosts."${cfg.host}" = proxy {
|
||||
"/" = {
|
||||
proxyPass = "http://${config.my.localhost}:${
|
||||
toString config.services.audiobookshelf.port
|
||||
}";
|
||||
proxyPass = cfg.local;
|
||||
extraConfig = ''
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
Reference in New Issue
Block a user