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

feat(makanek): add onomastics service

This commit is contained in:
2021-10-12 22:03:29 +02:00
parent c50698f275
commit a1e88e30a7
2 changed files with 39 additions and 0 deletions

38
configs/names.nix Normal file
View File

@@ -0,0 +1,38 @@
{ pkgs, lib, ... }:
let
port = 5703;
geogen = (pkgs.fetchFromGitHub {
owner = "kmein";
repo = "scripts";
rev = "c553c212efb04c300edf675c39a87fffd32d4def";
sha256 = "0b5xjr7qqgvwc76pqr84p81svzk6nqr5pdvc6daw94rcgdy02mva";
}) + "/onomastics";
inherit (pkgs.callPackage geogen {}) dependencyEnv;
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}/wsgi.py" wsgi.py
${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}";
};
}

View File

@@ -58,6 +58,7 @@ in
<niveum/configs/version.nix> <niveum/configs/version.nix>
<niveum/configs/radio> <niveum/configs/radio>
<niveum/configs/gitea.nix> <niveum/configs/gitea.nix>
<niveum/configs/names.nix>
<niveum/configs/telegram-bots> <niveum/configs/telegram-bots>
<niveum/configs/weechat.nix> <niveum/configs/weechat.nix>
<niveum/configs/urlwatch.nix> <niveum/configs/urlwatch.nix>