From f1333608a54a3c6255d996844645f99a433ace94 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 9 Dec 2024 18:39:57 +0100 Subject: Add my custom shiori fork for bookmark management Signed-off-by: Mel --- services/shiori.nix | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 services/shiori.nix (limited to 'services') 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}/"; + }; + }; +} -- cgit 1.4.1