mirror of
https://github.com/kmein/niveum
synced 2026-03-16 18:21:07 +01:00
feat: add horoscopy website
This commit is contained in:
@@ -10,6 +10,7 @@ in
|
||||
./matterbridge.nix
|
||||
./menstruation.nix
|
||||
./moinbot.nix
|
||||
./horoscopy.nix
|
||||
./monitoring
|
||||
./moodle-dl-borsfaye.nix
|
||||
./names.nix
|
||||
|
||||
45
systems/makanek/horoscopy.nix
Normal file
45
systems/makanek/horoscopy.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
port = 5040;
|
||||
punkt = pkgs.fetchzip {
|
||||
url = "https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/tokenizers/punkt.zip";
|
||||
sha256 = "113cv87dj5ml7g8pjm7psk4q1hrf0zqpmc945lmpdz91vp2wn1nc";
|
||||
};
|
||||
horoscopy-src = pkgs.fetchzip {
|
||||
url = "http://c.krebsco.de/horoscopy.tar.gz";
|
||||
hash = "sha256-DMhPDSftSaQomnEf+/XBn6cYIAJbs8BBJUGSi9NHLr4=";
|
||||
stripRoot = false;
|
||||
};
|
||||
horoscopy = import horoscopy-src;
|
||||
in
|
||||
{
|
||||
systemd.services.horoscopy = {
|
||||
wants = [ "network-online.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
description = "AI astrologer";
|
||||
serviceConfig = {
|
||||
DynamicUser = true;
|
||||
};
|
||||
environment.NLTK_DATA = pkgs.linkFarm "punkt-tokenizers" [
|
||||
{ name = "tokenizers/punkt"; path = punkt; }
|
||||
];
|
||||
script = ''
|
||||
cd ${horoscopy-src}
|
||||
${horoscopy.dependencyEnv}/bin/gunicorn wsgi:app -b :${toString port}
|
||||
'';
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedGzipSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedTlsSettings = true;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."horoscopy.kmein.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user