1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00
Files
niveum/systems/makanek/names.nix

36 lines
835 B
Nix

{
pkgs,
lib,
...
}: let
port = 5703;
geogen-src = "${<scripts>}/onomastics";
geogen = pkgs.callPackage geogen-src {};
in {
systemd.services.names = {
wants = ["network-online.target"];
wantedBy = ["multi-user.target"];
description = "Better clone of geogen.stoepel.net";
serviceConfig = {
DynamicUser = true;
};
script = ''
cd $(mktemp -d)
ln -s "${geogen-src}/wsgi.py" wsgi.py
${geogen.dependencyEnv}/bin/gunicorn wsgi:app -b :${toString port}
'';
};
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
};
services.nginx.virtualHosts."names.kmein.r" = {
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
};
}