summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/shiori.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/services/shiori.nix b/services/shiori.nix
new file mode 100644
index 0000000..d57ebdc
--- /dev/null
+++ b/services/shiori.nix
@@ -0,0 +1,59 @@
+{ lib, pkgs, auxiliaryPkgs, ... }:
+
+let
+ inherit (pkgs) dockerTools;
+ inherit (auxiliaryPkgs) common;
+
+ # using my own fork for updated
+ # pocket data import support.
+ # see: https://github.com/go-shiori/shiori/pull/1023
+ shiori = pkgs.shiori.overrideAttrs {
+ src = pkgs.fetchFromGitHub {
+ owner = "melnary";
+ repo = "shiori";
+ rev = "68e2e50ce57113e3074504ed7a537415396fa757";
+ sha256 = "sha256-8EPW3iot/14nv4G3rLSKMy+fOw6NiCT5TIBjleIPJxE=";
+ };
+
+ vendorHash = "sha256-PEQemiipVywSuSY2LCAa8g5YT/0bjdyDfyiAVjgTfOA=";
+ };
+
+ shioriLocalPort = 1989;
+ shioriDir = "/srv/shiori";
+
+ shioriImage = dockerTools.streamLayeredImage {
+ name = "shiori";
+ tag = shiori.version;
+ fromImage = common.alpine.base;
+ contents = [ shiori ];
+ };
+
+in
+{
+ foundation.services.shiori = {
+ image = shioriImage;
+ ports = [ [ shioriLocalPort 8080 ] ];
+
+ volumes = [
+ [ "${shioriDir}" "/shiori" ]
+ ];
+
+ environment = {
+ SHIORI_HTTP_ROOT_PATH = "/shiori/";
+ SHIORI_DIR = "/shiori";
+ };
+
+ entrypoint = "${shiori}/bin/shiori";
+ cmd = [ "server" ];
+ };
+
+ services.nginx.virtualHosts.renard.locations = {
+ "/shiori" = {
+ return = "301 $scheme://$host$request_uri/";
+ };
+
+ "/shiori/" = {
+ proxyPass = "http://127.0.0.1:${toString shioriLocalPort}/";
+ };
+ };
+}