property: setup server
This commit is contained in:
parent
2def7bcac0
commit
50528b1716
7 changed files with 61 additions and 13 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -4,3 +4,6 @@
|
|||
[submodule "wetten"]
|
||||
path = wetten
|
||||
url = ssh://gogs@git.ingolf-wagner.de:443/palo/wetten.git
|
||||
[submodule "submodules/property"]
|
||||
path = submodules/property
|
||||
url = ssh://gogs@git.ingolf-wagner.de:443/palo/property_crawlers.git
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
./metabase.nix
|
||||
./jupyter.nix
|
||||
./mysql.nix
|
||||
./property.nix
|
||||
];
|
||||
|
||||
# todo: add this to each file instead summing that here
|
||||
|
|
|
@ -11,14 +11,10 @@
|
|||
|
||||
services.mysqlBackup = {
|
||||
enable = true;
|
||||
databases = [
|
||||
"property"
|
||||
];
|
||||
databases = [ "property" ];
|
||||
user = "root";
|
||||
};
|
||||
|
||||
backup.dirs = [
|
||||
config.services.mysqlBackup.location
|
||||
];
|
||||
backup.dirs = [ config.services.mysqlBackup.location ];
|
||||
|
||||
}
|
||||
|
|
43
configs/workhorse/property.nix
Normal file
43
configs/workhorse/property.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{
|
||||
|
||||
users.users.property = {};
|
||||
|
||||
systemd.services.property = {
|
||||
enable = true;
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
path = [
|
||||
(pkgs.python3.withPackages (ps: with ps; [
|
||||
flask
|
||||
selenium
|
||||
beautifulsoup4
|
||||
urllib3
|
||||
sqlalchemy
|
||||
mysqlclient
|
||||
pytest
|
||||
dateparser
|
||||
geopy
|
||||
nltk
|
||||
click
|
||||
]))
|
||||
];
|
||||
|
||||
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"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
16
shell.nix
16
shell.nix
|
@ -38,11 +38,19 @@ let
|
|||
};
|
||||
};
|
||||
|
||||
system = name: {
|
||||
system = name:
|
||||
let
|
||||
exclusive = name:
|
||||
if name == "workhorse" then {
|
||||
property.file = toString ./submodules/property;
|
||||
} else {
|
||||
};
|
||||
in
|
||||
{
|
||||
system.file = toString ./system;
|
||||
configs.file = toString ./configs;
|
||||
nixos-config.symlink = "configs/${name}/configuration.nix";
|
||||
};
|
||||
} // (exclusive name);
|
||||
|
||||
desktopSecrets = {
|
||||
desktop_secrets.pass = {
|
||||
|
@ -119,10 +127,6 @@ let
|
|||
url = "https://github.com/mrVanDalo/nixos-configs.git";
|
||||
ref = "76260ad60cd99d40ab25df1400b0663d48e736db";
|
||||
};
|
||||
|
||||
# enable only on workhorse
|
||||
# wetten.file = toString ./wetten;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
|
1
submodules/property
Submodule
1
submodules/property
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit f2ddb4affcca8e348cd9d6cd457e25c9fe2caed4
|
|
@ -234,7 +234,7 @@ in {
|
|||
};
|
||||
}))
|
||||
|
||||
navi
|
||||
dino # jabber client
|
||||
|
||||
nixos-generators
|
||||
shellcheck
|
||||
|
|
Loading…
Reference in a new issue