blob: 4e45a11ca0277d817c4e3b6b060aac1a0bdda972 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
{
pkgs,
config,
lib,
...
}: {
systemd.services.arXiv-randomizer = let
python = pkgs.python3.withPackages (ps:
with ps; [
beautifulsoup4
dateutil
numpy
flask
feedparser
gunicorn
]);
arXiv-randomizer = builtins.fetchGit {
url = "https://git.tzlil.net/arXiv.git";
ref = "master";
rev = "d09927ca6f7af2404e9c3a09a6e99dfdd1e87577";
};
in {
after = ["network.target"];
wantedBy = ["multi-user.target"];
script = "${lib.getExe python} -m gunicorn -w 5 --log-level debug -b 0.0.0.0:3000 --timeout 90 app:app";
serviceConfig = {
Restart = "on-failure";
RestartSec = 0;
WorkingDirectory="${arXiv-randomizer}";
};
};
services.caddy = {
virtualHosts."tzlil.net".extraConfig = ''
redir /arXiv /arXiv/
handle_path /arXiv/* {
reverse_proxy :3000
}
'';
};
}
|