mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-27 09:54:53 +00:00
30 lines
669 B
Nix
30 lines
669 B
Nix
{ config, lib, ... }:
|
|
{
|
|
|
|
config = lib.mkIf config.services.audiobookshelf.enable {
|
|
|
|
services.audiobookshelf = {
|
|
group = "shared";
|
|
dataDir = "audiobookshelf";
|
|
};
|
|
|
|
# Allow web traffic to Caddy
|
|
caddy.routes = [
|
|
{
|
|
match = [ { host = [ config.hostnames.audiobooks ]; } ];
|
|
handle = [
|
|
{
|
|
handler = "reverse_proxy";
|
|
upstreams = [ { dial = "localhost:${builtins.toString config.services.audiobookshelf.port}"; } ];
|
|
}
|
|
];
|
|
}
|
|
];
|
|
|
|
# Configure Cloudflare DNS to point to this machine
|
|
services.cloudflare-dyndns.domains = [ config.hostnames.audiobooks ];
|
|
|
|
};
|
|
|
|
}
|