From 05d397f53e1147a7531bca1e11fb94f1f5acc60e Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Thu, 23 Jan 2025 08:16:51 -0600 Subject: [PATCH 1/2] vps: add shiori --- sys/platforms/vps/srv/default.nix | 1 + sys/platforms/vps/srv/shiori.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 sys/platforms/vps/srv/shiori.nix diff --git a/sys/platforms/vps/srv/default.nix b/sys/platforms/vps/srv/default.nix index 9a43916..eb607a1 100644 --- a/sys/platforms/vps/srv/default.nix +++ b/sys/platforms/vps/srv/default.nix @@ -15,5 +15,6 @@ with lib; { ./paperless.nix ./trilium.nix ./syncthing.nix + ./shiori.nix ]; } diff --git a/sys/platforms/vps/srv/shiori.nix b/sys/platforms/vps/srv/shiori.nix new file mode 100644 index 0000000..309200d --- /dev/null +++ b/sys/platforms/vps/srv/shiori.nix @@ -0,0 +1,29 @@ +{ + lib, + pkgs, + ... +}: +with lib; { + services = { + nginx = { + virtualHosts."bookmarks.posixlycorrect.com" = { + enableACME = true; + forceSSL = true; + extraConfig = '' + proxy_headers_hash_max_size 512; + proxy_headers_hash_bucket_size 128; + ''; + locations."/" = { + proxyPass = "http://127.0.0.1:8089"; + }; + }; + }; + + shiori = { + enable = true; + address = "127.0.0.1"; + port = 8089; + environmentFile = "/var/trust/shiori/env"; + }; + }; +} From dd6a8f9e1cab9c58a9129c407d250b2cfee7bf1e Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Thu, 23 Jan 2025 09:54:43 -0600 Subject: [PATCH 2/2] vps: add calibre --- sys/platforms/vps/srv/calibre-web.nix | 31 +++++++++++++++++++++++++++ sys/platforms/vps/srv/default.nix | 1 + 2 files changed, 32 insertions(+) create mode 100644 sys/platforms/vps/srv/calibre-web.nix diff --git a/sys/platforms/vps/srv/calibre-web.nix b/sys/platforms/vps/srv/calibre-web.nix new file mode 100644 index 0000000..7432ae3 --- /dev/null +++ b/sys/platforms/vps/srv/calibre-web.nix @@ -0,0 +1,31 @@ +{ + lib, + pkgs, + ... +}: +with lib; { + services = { + nginx = { + virtualHosts."calibre.posixlycorrect.com" = { + enableACME = true; + forceSSL = true; + extraConfig = '' + proxy_headers_hash_max_size 512; + proxy_headers_hash_bucket_size 128; + ''; + locations."/" = { + proxyPass = "http://[::1]:8083"; + }; + }; + }; + + calibre-web = { + enable = true; + openFirewall = true; + options = { + enableBookUploading = true; + calibreLibrary = "/var/lib/calibre-web/calibre_library"; + }; + }; + }; +} diff --git a/sys/platforms/vps/srv/default.nix b/sys/platforms/vps/srv/default.nix index eb607a1..29c4bf3 100644 --- a/sys/platforms/vps/srv/default.nix +++ b/sys/platforms/vps/srv/default.nix @@ -16,5 +16,6 @@ with lib; { ./trilium.nix ./syncthing.nix ./shiori.nix + ./calibre-web.nix ]; }