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

31 lines
618 B
Nix
Raw Normal View History

2024-12-26 00:13:42 +00:00
{ config, lib, ... }:
2024-12-14 20:19:42 +00:00
2024-12-26 00:13:42 +00:00
with lib;
let
cfg = config.features.homelab.audiobookshelf;
in
2024-12-14 20:19:42 +00:00
{
2024-12-26 00:13:42 +00:00
options.features.homelab.audiobookshelf.enable = mkEnableOption "Enable audiobookshelf";
2024-12-14 20:19:42 +00:00
2024-12-26 00:13:42 +00:00
config = mkIf cfg.enable {
services.audiobookshelf = {
enable = true;
host = "audiobookshelf.davies.home";
port = 4001;
};
2024-12-14 20:19:42 +00:00
2024-12-26 00:13:42 +00:00
services.nginx = {
enable = true;
2024-12-14 20:19:42 +00:00
2024-12-26 00:13:42 +00:00
virtualHosts."audiobookshelf.davies.home" = {
locations."/" = {
proxyPass = "http://localhost:${toString config.services.audiobookshelf.port}/";
proxyWebsockets = true;
};
2024-12-14 20:19:42 +00:00
};
};
};
}