dotfiles/nix/modules/nixos/features/homelab/audiobookshelf.nix

27 lines
533 B
Nix

{ config, lib, ... }:
with lib;
let
cfg = config.features.homelab.audiobookshelf;
in
{
options.features.homelab.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
config = mkIf cfg.enable {
services = {
audiobookshelf = {
enable = true;
port = 4001;
};
caddy.virtualHosts."audiobookshelf.oliverdavies.uk" = {
useACMEHost = "oliverdavies.uk";
extraConfig = "reverse_proxy localhost:${toString config.services.audiobookshelf.port}";
};
};
};
}