2019-09-24 18:39:03 +02:00
|
|
|
{config, lib, pkgs, ...}:
|
|
|
|
let
|
|
|
|
web_port = 9011;
|
|
|
|
statedir = "/var/lib/shiori";
|
|
|
|
in {
|
2021-04-04 10:24:55 +02:00
|
|
|
state = [ "/var/lib/private/shiori" ]; # when using dynamicUser
|
2019-09-24 18:39:03 +02:00
|
|
|
systemd.services.shiori = {
|
|
|
|
description = "Shiori Server";
|
|
|
|
after = [ "network-online.target" ];
|
|
|
|
environment = {
|
|
|
|
SHIORI_DIR = statedir;
|
|
|
|
};
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
DynamicUser = true;
|
|
|
|
StateDirectory = "shiori";
|
|
|
|
ExecStart = "${pkgs.shiori}/bin/shiori serve -a 127.0.0.1 -p ${toString web_port}";
|
|
|
|
PrivateTmp = true;
|
|
|
|
};
|
|
|
|
};
|
2019-09-25 14:54:55 +02:00
|
|
|
services.nginx.virtualHosts."bookmark.euer.krebsco.de" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
|
|
|
|
locations."/" = {
|
2019-09-24 18:39:03 +02:00
|
|
|
proxyPass = "http://127.0.0.1:${toString web_port}/";
|
|
|
|
};
|
2019-09-25 14:54:55 +02:00
|
|
|
};
|
2019-09-24 18:39:03 +02:00
|
|
|
}
|