2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
2025-12-19 15:05:29 +01:00
|
|
|
}:
|
|
|
|
|
let
|
2021-12-15 00:10:06 +01:00
|
|
|
tarotPort = 7407;
|
2025-12-20 11:45:58 +01:00
|
|
|
ichingPort = 1819;
|
2021-12-15 00:10:06 +01:00
|
|
|
tarotFiles = pkgs.fetchzip {
|
|
|
|
|
url = "https://c.krebsco.de/tarot.zip";
|
|
|
|
|
sha256 = "0jl5vdwlj17pqp94yj02xgsb1gyvs9i08m83kac0jdnhfjl2f75a";
|
|
|
|
|
stripRoot = false;
|
|
|
|
|
};
|
2021-12-15 15:01:19 +01:00
|
|
|
tarotKey = builtins.fetchurl {
|
|
|
|
|
url = "http://c.krebsco.de/tarot.pdf";
|
2021-12-16 00:19:28 +01:00
|
|
|
sha256 = "1n2m53kjg2vj9dbr70b9jrsbqwdfrcb48l4wswn21549fi24g6dx";
|
2021-12-15 15:01:19 +01:00
|
|
|
};
|
2025-12-19 15:05:29 +01:00
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
systemd.services.tarot = {
|
|
|
|
|
enable = true;
|
|
|
|
|
serviceConfig.Type = "simple";
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2025-12-20 11:31:12 +01:00
|
|
|
environment = {
|
|
|
|
|
TAROT_FILES = tarotFiles;
|
|
|
|
|
TAROT_PORT = toString tarotPort;
|
|
|
|
|
};
|
2025-12-19 15:05:29 +01:00
|
|
|
serviceConfig.ExecStart = pkgs.writers.writePython3 "tarot-server" {
|
2025-12-20 11:31:12 +01:00
|
|
|
libraries = py: [
|
|
|
|
|
py.pillow
|
|
|
|
|
py.flask
|
|
|
|
|
];
|
|
|
|
|
} ./tarot.py;
|
2021-12-15 00:10:06 +01:00
|
|
|
};
|
|
|
|
|
|
2025-12-20 11:45:58 +01:00
|
|
|
systemd.services.iching = {
|
|
|
|
|
enable = true;
|
|
|
|
|
serviceConfig.Type = "simple";
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
environment = {
|
|
|
|
|
ICHING_PORT = toString ichingPort;
|
|
|
|
|
};
|
|
|
|
|
serviceConfig.ExecStart = pkgs.writers.writePython3 "iching-server" {
|
|
|
|
|
libraries = py: [
|
|
|
|
|
py.flask
|
|
|
|
|
];
|
|
|
|
|
} ./iching.py;
|
|
|
|
|
};
|
|
|
|
|
|
2022-05-22 11:47:59 +02:00
|
|
|
niveum.passport.services = [
|
|
|
|
|
rec {
|
|
|
|
|
link = "https://tarot.kmein.de";
|
|
|
|
|
title = "Tarot";
|
|
|
|
|
description = "draws Tarot cards for you. See <a href=\"${link}/files/key.pdf\">here</a> for information on how to interpret them.";
|
|
|
|
|
}
|
2025-12-20 11:45:58 +01:00
|
|
|
{
|
|
|
|
|
link = "https://iching.kmein.de";
|
|
|
|
|
title = "I Ching";
|
|
|
|
|
description = "draws I Ching hexagrams for you.";
|
|
|
|
|
}
|
2022-05-22 11:47:59 +02:00
|
|
|
];
|
|
|
|
|
|
2025-12-20 11:45:58 +01:00
|
|
|
services.nginx.virtualHosts."iching.kmein.de" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
|
|
|
|
locations = {
|
|
|
|
|
"/".proxyPass = "http://127.0.0.1:${toString ichingPort}/";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-15 12:37:41 +01:00
|
|
|
services.nginx.virtualHosts."tarot.kmein.de" = {
|
|
|
|
|
enableACME = true;
|
|
|
|
|
forceSSL = true;
|
2021-12-15 15:01:19 +01:00
|
|
|
locations = {
|
2025-12-19 15:05:29 +01:00
|
|
|
"/".proxyPass = "http://127.0.0.1:${toString tarotPort}/";
|
2021-12-15 15:01:19 +01:00
|
|
|
"/files/" = {
|
|
|
|
|
root = pkgs.linkFarm "tarot" [
|
2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
name = "files/key.pdf";
|
|
|
|
|
path = tarotKey;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
name = "files/cards";
|
|
|
|
|
path = tarotFiles;
|
|
|
|
|
}
|
2021-12-15 15:01:19 +01:00
|
|
|
];
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
autoindex on;
|
|
|
|
|
charset UTF-8;
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-12-15 00:10:06 +01:00
|
|
|
};
|
|
|
|
|
}
|