From 0ef661aae7ed1621fd8f80b903b6359b2663a2f6 Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Tue, 15 Oct 2024 22:51:46 +0100 Subject: [PATCH 1/2] kilgharrah: serve audiobookshelf --- hosts/kilgharrah/default.nix | 4 ++++ hosts/kilgharrah/filesystems.nix | 2 ++ services/audiobookshelf.nix | 32 ++++++++++++++++++++++++++++++++ services/default.nix | 1 + 4 files changed, 39 insertions(+) create mode 100644 services/audiobookshelf.nix 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 From 390a60f5989a1cc5d92a80521f8ea32b9d23f76f Mon Sep 17 00:00:00 2001 From: Katherina Walshe-Grey Date: Mon, 21 Oct 2024 12:43:34 +0100 Subject: [PATCH 2/2] kilgharrah: add commented-out custom nvidia driver keeping in the repo for future testing --- hosts/kilgharrah/hardware.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/hosts/kilgharrah/hardware.nix b/hosts/kilgharrah/hardware.nix index 899e591..f00dfbd 100644 --- a/hosts/kilgharrah/hardware.nix +++ b/hosts/kilgharrah/hardware.nix @@ -7,5 +7,23 @@ services.xserver.videoDrivers = [ "nvidia" ]; hardware.nvidia.modesetting.enable = true; # this defaults to true from 24.11 + + # # Downgrade to driver version 535 as 550 has problems with Wayland + # hardware.nvidia.package = + # let + # rcu_patch = pkgs.fetchpatch { + # url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch"; + # hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg="; + # }; + # in + # config.boot.kernelPackages.nvidiaPackages.mkDriver { + # version = "535.154.05"; + # sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg="; + # sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k="; + # openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo="; + # settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10="; + # persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE="; + # patches = [ rcu_patch ]; + # }; }