From 09a1d286d0190599caea7e499a3ad8baae47bdac Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 21 Apr 2023 07:15:05 +0000 Subject: [PATCH] servo: enable `komga`, a comic/manga webapp --- hosts/by-name/servo/services/default.nix | 1 + hosts/by-name/servo/services/komga.nix | 22 ++++++++++++++++++++++ hosts/common/ids.nix | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 hosts/by-name/servo/services/komga.nix diff --git a/hosts/by-name/servo/services/default.nix b/hosts/by-name/servo/services/default.nix index e3b10ff3..2516e90e 100644 --- a/hosts/by-name/servo/services/default.nix +++ b/hosts/by-name/servo/services/default.nix @@ -13,6 +13,7 @@ ./jackett.nix ./jellyfin.nix ./kiwix-serve.nix + ./komga.nix ./matrix ./navidrome.nix ./nixserve.nix diff --git a/hosts/by-name/servo/services/komga.nix b/hosts/by-name/servo/services/komga.nix new file mode 100644 index 00000000..4ddedb92 --- /dev/null +++ b/hosts/by-name/servo/services/komga.nix @@ -0,0 +1,22 @@ +{ config, ... }: +let + svc-cfg = config.services.komga; + inherit (svc-cfg) user group port stateDir; +in +{ + sane.persist.sys.plaintext = [ + { inherit user group; mode = "0700"; directory = stateDir; } + ]; + + services.komga.enable = true; + services.komga.port = 11319; # chosen at random + + services.nginx.virtualHosts."komga.uninsane.org" = { + addSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${builtins.toString port}"; + }; + }; + sane.services.trust-dns.zones."uninsane.org".inet.CNAME."komga" = "native"; +} diff --git a/hosts/common/ids.nix b/hosts/common/ids.nix index 65445f61..7b5d0947 100644 --- a/hosts/common/ids.nix +++ b/hosts/common/ids.nix @@ -34,6 +34,8 @@ sane.ids.navidrome.gid = 2405; sane.ids.calibre-web.uid = 2406; sane.ids.calibre-web.gid = 2406; + sane.ids.komga.uid = 2407; + sane.ids.komga.gid = 2407; sane.ids.colin.uid = 1000; sane.ids.guest.uid = 1100;