mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-19 03:20:14 +00:00
.github
colorscheme
deploy
docs
hosts
lib
misc
modules
overlays
pkgs
platforms
generators
home-manager
nix-darwin
nixos
modules
nmasur
presets
programs
services
actualbudget
arr
cloudflare
gitea-runner-local
grafana
influxdb2
litestream
mathesar
metrics
nextcloud
paperless
restic
vaultwarden
wireguard
audiobookshelf.nix
avahi.nix
bind.nix
caddy.nix
calibre-web.nix
cloudflared.nix
empty-trash.nix
filebrowser.nix
gitea.nix
grub.nix
immich.nix
jellyfin.nix
journald.nix
kanata.nix
karakeep.nix
lightdm.nix
logind.nix
minecraft-server.nix
n8n.nix
nix-autoupgrade.nix
nix-daemon.nix
nix.nix
notes-git-sync.nix
ntfy-sh.nix
openssh-aws.nix
openssh.nix
pgweb.nix
pipewire.nix
postgresql.nix
redshift.nix
samba.nix
thelounge.nix
transmission.nix
uptime-kuma.nix
vm.nix
zfs.nix
profiles
services
settings.nix
services
nixpkgs.nix
secrets.nix
windows
templates
.envrc
.gitignore
.stylua.toml
LICENSE
README.md
flake.lock
flake.nix
45 lines
914 B
Nix
45 lines
914 B
Nix
{
|
|
config,
|
|
lib,
|
|
hostnames,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.nmasur.presets.services.audiobookshelf;
|
|
in
|
|
|
|
{
|
|
|
|
options.nmasur.presets.services.audiobookshelf.enable =
|
|
lib.mkEnableOption "Audiobookshelf e-book and audiobook manager";
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.audiobookshelf = {
|
|
enable = true;
|
|
|
|
# This is the default /var/lib/audiobookshelf
|
|
dataDir = "audiobookshelf";
|
|
};
|
|
|
|
# Allow web traffic to Caddy
|
|
nmasur.presets.services.caddy.routes = [
|
|
{
|
|
match = [ { host = [ 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 = [ hostnames.audiobooks ];
|
|
|
|
};
|
|
|
|
}
|