diff --git a/hosts/kilgharrah/default.nix b/hosts/kilgharrah/default.nix index eb7bf49..14d6aba 100644 --- a/hosts/kilgharrah/default.nix +++ b/hosts/kilgharrah/default.nix @@ -34,6 +34,10 @@ }; programs.steam.enable = true; + qenya.services.audiobookshelf = { + enable = true; + domain = "audiobookshelf.qenya.tel"; + }; qenya.services.jellyfin = { enable = true; domain = "jellyfin.qenya.tel"; diff --git a/hosts/kilgharrah/filesystems.nix b/hosts/kilgharrah/filesystems.nix index b69c72e..cc77c4e 100644 --- a/hosts/kilgharrah/filesystems.nix +++ b/hosts/kilgharrah/filesystems.nix @@ -76,9 +76,11 @@ "rpool_albion/data" = { mountpoint = "none"; }; "rpool_albion/data/steam" = { mountpoint = "/home/qenya/.local/share/Steam"; }; "rpool_albion/state" = { mountpoint = "none"; }; + "rpool_albion/state/audiobookshelf" = { mountpoint = "/var/lib/audiobookshelf"; }; "rpool_albion/state/jellyfin" = { mountpoint = "/var/lib/jellyfin"; }; "rpool_albion/state/navidrome" = { mountpoint = "/var/lib/navidrome"; }; "rpool_albion/srv" = { mountpoint = "none"; }; + "rpool_albion/srv/audiobookshelf" = { mountpoint = "/srv/audiobookshelf"; }; "rpool_albion/srv/ftp" = { mountpoint = "/srv/ftp"; }; "rpool_albion/srv/jellyfin" = { mountpoint = "/srv/jellyfin"; }; "rpool_albion/srv/music" = { mountpoint = "/srv/music"; }; diff --git a/services/audiobookshelf.nix b/services/audiobookshelf.nix new file mode 100644 index 0000000..80cc659 --- /dev/null +++ b/services/audiobookshelf.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.qenya.services.audiobookshelf; +in +{ + options.qenya.services.audiobookshelf = { + enable = mkEnableOption "Audiobookshelf"; + domain = mkOption { + type = types.str; + }; + }; + + config = mkIf cfg.enable { + services.nginx = { + enable = true; + virtualHosts = { + ${cfg.domain} = { + forceSSL = true; + enableACME = true; + locations."/".proxyPass = "http://127.0.0.1:8234/"; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + services.audiobookshelf.enable = true; + services.audiobookshelf.port = 8234; + }; +} diff --git a/services/default.nix b/services/default.nix index 4a25d41..a83117a 100644 --- a/services/default.nix +++ b/services/default.nix @@ -1,6 +1,7 @@ { imports = [ ./actual.nix + ./audiobookshelf.nix ./forgejo.nix ./jellyfin.nix ./navidrome.nix