audiobookshelf using built in options

This commit is contained in:
Geir Okkenhaug Jerstad 2024-06-15 11:41:38 +02:00
parent 42bd581b45
commit a4ea7e5343

View file

@ -1,34 +1,11 @@
{ configs, pkgs, ... }: { configs, pkgs, ... }:
let
audioBookShelfPort = 8000;
in
{ {
environment.systemPackages = [ environment.systemPackages = [
pkgs.audiobookshelf pkgs.audiobookshelf
]; ];
systemd.services = {
audiobookshelf = {
description = "Audiobookshelf";
wantedBy = ["multi-user.target"];
restartIfChanged = true;
environment = {
PORT = builtins.toString audioBookShelfPort;
HOST = "0.0.0.0";
};
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "5";
ExecStart = ''
${pkgs.audiobookshelf}/bin/audiobookshelf
'';
};
};
};
services.audiobookshelf.group = "users"; services.audiobookshelf.group = "users";
networking.firewall.allowedTCPPorts = [ audioBookShelfPort ]; services.audiobookshelf.enable = true;
#services.audiobookshelf.enable = true; services.audiobookshelf.host = 0.0.0.0 ;
#services.audiobookshelf.host = 0.0.0.0 ; services.audiobookshelf.port = 8000;
#services.audiobookshelf.port = 8000; services.audiobookshelf.openFirewall = true;
#services.audiobookshelf.openFirewall = true;
} }