challenger: add audiobookshelf

This commit is contained in:
Felix Albrigtsen 2025-11-13 23:12:05 +01:00
parent c0e19e7c21
commit 261b19f7c3
2 changed files with 57 additions and 0 deletions

View File

@ -13,6 +13,7 @@
./filesystems.nix ./filesystems.nix
# ./services/archivebox.nix # ./services/archivebox.nix
./services/audiobookshelf.nix
./services/calibre.nix ./services/calibre.nix
# ./services/ersatztv.nix # ./services/ersatztv.nix
./services/jellyfin.nix ./services/jellyfin.nix

View File

@ -0,0 +1,56 @@
{ config, lib, pkgs, ... }:
let
domain = "audiobooks.home.feal.no";
host = "127.0.1.2";
port = 5016;
in {
fileSystems = {
"/var/lib/audiobookshelf" = {
device = "/tank/media/audiobookshelf/config";
options = [ "bind" ];
};
};
services.audiobookshelf = {
enable = true;
dataDir = "audiobookshelf";
inherit host port;
};
systemd.services.audiobookshelf = {
serviceConfig = {
# Better safe than sorry :)
CapabilityBoundingSet = "";
LockPersonality = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateMounts = true;
PrivateTmp = true;
PrivateUsers = true;
ProtectClock = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProtectSystem = "strict";
ReadWritePaths = [
"/var/lib/audiobookshelf"
"/tank/media/audiobookshelf"
];
RemoveIPC = true;
RestrictSUIDSGID = true;
UMask = "0007";
RestrictAddressFamilies = [ "AF_UNIX AF_INET AF_INET6" ];
SystemCallArchitectures = "native";
};
};
services.nginx.virtualHosts.${domain} = {
locations."/" = {
proxyPass = "http://${host}:${toString port}";
proxyWebsockets = true;
};
};
}