Make audiobookshelf togglable per host
This commit is contained in:
parent
9a10b7017b
commit
f55e94ad4c
|
@ -1,20 +1,29 @@
|
||||||
{ config, ... }:
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.features.homelab.audiobookshelf;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.audiobookshelf = {
|
options.features.homelab.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
|
||||||
enable = true;
|
|
||||||
|
|
||||||
host = "audiobookshelf.davies.home";
|
config = mkIf cfg.enable {
|
||||||
port = 4001;
|
services.audiobookshelf = {
|
||||||
};
|
enable = true;
|
||||||
|
|
||||||
services.nginx = {
|
host = "audiobookshelf.davies.home";
|
||||||
enable = true;
|
port = 4001;
|
||||||
|
};
|
||||||
|
|
||||||
virtualHosts."audiobookshelf.davies.home" = {
|
services.nginx = {
|
||||||
locations."/" = {
|
enable = true;
|
||||||
proxyPass = "http://localhost:${toString config.services.audiobookshelf.port}/";
|
|
||||||
proxyWebsockets = true;
|
virtualHosts."audiobookshelf.davies.home" = {
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:${toString config.services.audiobookshelf.port}/";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue