mirror of
https://github.com/nickolaj-jepsen/nixos.git
synced 2026-01-22 16:16:50 +01:00
feat: add audiobookshelf
This commit is contained in:
parent
392c77debd
commit
4aa1f38ab9
3 changed files with 42 additions and 0 deletions
35
modules/homelab/audiobookshelf.nix
Normal file
35
modules/homelab/audiobookshelf.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.mkIf config.fireproof.homelab.enable (let
|
||||
domain = "audiobookshelf.nickolaj.com";
|
||||
port = 8234;
|
||||
in {
|
||||
services.restic.backups.homelab.paths = ["/var/lib/audiobookshelf"];
|
||||
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
http2 = true;
|
||||
locations."/" = {
|
||||
proxyWebsockets = true;
|
||||
proxyPass = "http://localhost:${toString port}/";
|
||||
};
|
||||
};
|
||||
|
||||
services.audiobookshelf = {
|
||||
enable = true;
|
||||
inherit port;
|
||||
user = "media";
|
||||
group = "media";
|
||||
};
|
||||
|
||||
# Create the audiobook, ebook, and podcast directories
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /mnt/data/audiobooks 0775 media media -"
|
||||
"d /mnt/data/books 0775 media media -"
|
||||
"d /mnt/data/podcasts 0775 media media -"
|
||||
];
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue