mirror of
https://gitlab.com/upRootNutrition/dotfiles.git
synced 2025-06-16 10:05:13 -05:00
feat: added audiobookshelf
This commit is contained in:
parent
b6f45eb6d9
commit
9d3ad35ef1
3 changed files with 74 additions and 0 deletions
|
@ -38,6 +38,7 @@ in
|
|||
"syncthing"
|
||||
"searx"
|
||||
"vaultwarden"
|
||||
"audiobookshelf"
|
||||
]
|
||||
)
|
||||
++ (map
|
||||
|
|
43
modules/nixos/services/audiobookshelf/default.nix
Normal file
43
modules/nixos/services/audiobookshelf/default.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ flake, config, ... }:
|
||||
let
|
||||
inherit (flake.config.instances) audiobookshelf web;
|
||||
service = audiobookshelf;
|
||||
host = "${service.subdomain}.${web.domains.url0}";
|
||||
localhost = web.localhost.address0;
|
||||
in
|
||||
{
|
||||
services = {
|
||||
audiobookshelf = {
|
||||
enable = true;
|
||||
host = host;
|
||||
};
|
||||
caddy = {
|
||||
virtualHosts = {
|
||||
"${host}" = {
|
||||
extraConfig = ''
|
||||
reverse_proxy ${localhost}:${toString service.ports.port0} {
|
||||
header_up X-Real-IP {remote_host}
|
||||
}
|
||||
|
||||
tls ${service.ssl.cert} ${service.ssl.key}
|
||||
|
||||
encode zstd gzip
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"Z ${service.paths.path0} 0755 ${service.name} ${service.name} -"
|
||||
"Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
|
||||
];
|
||||
|
||||
networking = {
|
||||
firewall = {
|
||||
allowedTCPPorts = [
|
||||
service.ports.port0
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue