nixos-config/nixos/configs/workhorse/property.nix

44 lines
848 B
Nix
Raw Normal View History

2020-10-08 21:09:35 +02:00
{ lib, pkgs, config, ... }: {
2020-09-21 23:03:55 +02:00
2021-07-10 16:30:12 +02:00
users.users.property = { isSystemUser = true; };
2020-09-21 23:03:55 +02:00
systemd.services.property = {
enable = true;
wantedBy = [ "multi-user.target" ];
path = [
2020-10-08 21:09:35 +02:00
(pkgs.python3.withPackages (ps:
with ps; [
flask
selenium
beautifulsoup4
urllib3
sqlalchemy
mysqlclient
pytest
dateparser
geopy
nltk
click
]))
2020-09-21 23:03:55 +02:00
];
serviceConfig = { User = "property"; };
script = ''
FLASK_APP=${<property>}/server.py \
FLASK_RUN_PORT=7888 \
flask run --host 0.0.0.0 \
"$@"
'';
};
services.nginx = {
enable = true;
virtualHosts = {
"property.workhorse.private" = {
locations."/" = { proxyPass = "http://localhost:7888"; };
};
};
};
}