dotfiles/modules/nixos/services/audiobookshelf.nix

30 lines
669 B
Nix
Raw Normal View History

2024-10-12 15:18:54 +00:00
{ config, lib, ... }:
{
config = lib.mkIf config.services.audiobookshelf.enable {
services.audiobookshelf = {
group = "shared";
2024-10-12 15:18:54 +00:00
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 ];
};
}