From c26e63315edcb332f88482dde56af39f75891c70 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 14 Dec 2024 20:19:42 +0000 Subject: [PATCH] Add audiobookshelf --- .../nixos/features/homelab/audiobookshelf.nix | 21 +++++++++++++++++++ .../nixos/features/homelab/default.nix | 1 + 2 files changed, 22 insertions(+) create mode 100644 nix/modules/nixos/features/homelab/audiobookshelf.nix diff --git a/nix/modules/nixos/features/homelab/audiobookshelf.nix b/nix/modules/nixos/features/homelab/audiobookshelf.nix new file mode 100644 index 0000000..6f5dd96 --- /dev/null +++ b/nix/modules/nixos/features/homelab/audiobookshelf.nix @@ -0,0 +1,21 @@ +{ config, ... }: + +{ + services.audiobookshelf = { + enable = true; + + host = "audiobookshelf.localhost"; + port = 4001; + }; + + services.nginx = { + enable = true; + + virtualHosts."audiobookshelf.localhost" = { + locations."/" = { + proxyPass = "http://localhost:${toString config.services.audiobookshelf.port}/"; + proxyWebsockets = true; + }; + }; + }; +} diff --git a/nix/modules/nixos/features/homelab/default.nix b/nix/modules/nixos/features/homelab/default.nix index fbf8259..d60cbb3 100644 --- a/nix/modules/nixos/features/homelab/default.nix +++ b/nix/modules/nixos/features/homelab/default.nix @@ -1,5 +1,6 @@ { imports = [ + ./audiobookshelf.nix ./gitea.nix ./immich.nix ./jellyfin.nix