From 7610e83b87950fc8d5890ea1ebc92fd6f9693fab Mon Sep 17 00:00:00 2001 From: Alexander Wainwright Date: Sun, 29 Jun 2025 22:35:05 +1000 Subject: [PATCH] Add audiobookshelf The package, a systetmd service and open the port. --- hosts/alt/configuration.nix | 25 ++++++++++++++++++++++++- hosts/modules/kafka-mounts.nix | 4 ++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/hosts/alt/configuration.nix b/hosts/alt/configuration.nix index 7e877ad..d6fb960 100644 --- a/hosts/alt/configuration.nix +++ b/hosts/alt/configuration.nix @@ -19,15 +19,38 @@ privileged = true; }; - networking.firewall.allowedTCPPorts = [ 8000 8080 9117 8191 ]; + networking.firewall.allowedTCPPorts = [ + 8000 + 8010 + 8080 + 9117 + 8191 + ]; networking.hostName = "alt"; # Define your hostname. environment.systemPackages = with pkgs; [ + audiobookshelf flaresolverr filebrowser ]; + # run audiobookshelf + systemd.services.audiobookshelf = { + description = "Audiobookshelf server"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "simple"; + User = "alex"; + WorkingDirectory = "/home/alex/audiobookshelf"; + ExecStart = "${pkgs.audiobookshelf}/bin/audiobookshelf --port 8010"; + Restart = "on-failure"; + RestartSec = "5s"; + }; + }; + # run filebrowser systemd.services.filebrowser = { description = "Filebrowser server"; diff --git a/hosts/modules/kafka-mounts.nix b/hosts/modules/kafka-mounts.nix index 24f4842..910035d 100644 --- a/hosts/modules/kafka-mounts.nix +++ b/hosts/modules/kafka-mounts.nix @@ -12,9 +12,9 @@ let }; mounts = { "/mnt/kafka/archive" = "//kafka.local/archive"; - "/mnt/kafka/downloads" = "//kafka.local/downloads"; "/mnt/kafka/backup" = "//kafka.local/backup"; - "/mnt/kafka/video" = "//kafka.local/video"; + "/mnt/kafka/books" = "//kafka.local/books"; + "/mnt/kafka/downloads" = "//kafka.local/downloads"; }; in {