Compare commits
No commits in common. "43164566feca0e0fef6a8a469c5786f6ad999216" and "901cb8c8111145897f7b0c3d3625f84d3270240d" have entirely different histories.
43164566fe
...
901cb8c811
@ -14,7 +14,6 @@
|
||||
./public.nix
|
||||
./radicale.nix
|
||||
./reichartstrasse.nix
|
||||
./wetter.nix
|
||||
./znc.nix
|
||||
];
|
||||
|
||||
|
@ -1,79 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
configFile = pkgs.writeText "wetter.cfg" ''
|
||||
SQLALCHEMY_DATABASE_URI="postgresql://wetter_web@/wetter?host=/run/postgresql"
|
||||
'';
|
||||
|
||||
in {
|
||||
users.users.wetter = {
|
||||
description = "Wetter Service";
|
||||
group = "wetter";
|
||||
home = "/var/lib/wetter/";
|
||||
useDefaultShell = true;
|
||||
isSystemUser = true;
|
||||
};
|
||||
users.groups.wetter = {};
|
||||
|
||||
users.users.wetter_web = {
|
||||
description = "Wetter Web Service";
|
||||
group = "wetter_web";
|
||||
home = "/var/lib/wetter/";
|
||||
useDefaultShell = true;
|
||||
isSystemUser = true;
|
||||
};
|
||||
users.groups.wetter_web = {};
|
||||
|
||||
services.postgresql = {
|
||||
ensureDatabases = [ "wetter" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "wetter";
|
||||
ensurePermissions = {
|
||||
"DATABASE wetter" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "wetter_scraper";
|
||||
ensurePermissions = {
|
||||
"DATABASE wetter" = "CONNECT";
|
||||
"SCHEMA public" = "USAGE";
|
||||
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "wetter_web";
|
||||
ensurePermissions = {
|
||||
"DATABASE wetter" = "CONNECT";
|
||||
"SCHEMA public" = "USAGE";
|
||||
"ALL TABLES IN SCHEMA public" = "SELECT";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services.wetter = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
RuntimeDirectory = "wetter";
|
||||
StateDirectory = "wetter";
|
||||
User = "wetter_web";
|
||||
Group = "wetter_web";
|
||||
};
|
||||
environment = {
|
||||
WETTER_SETTINGS = "${configFile}";
|
||||
};
|
||||
script = "gunicorn -w 4 -b [::1]:8234 wetter:app";
|
||||
path = with pkgs; [ (python38.withPackages (ps: [ ps.gunicorn wetter ])) ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts = {
|
||||
"wetter.clerie.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://[::1]:8234";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{ buildPythonPackage, fetchPypi, pyexcel-webio, flask }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "Flask-Excel";
|
||||
version = "0.0.7";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "b82ddfe6319ecf2f796ada9966737ac8eaf9a99d6bce773f8acdc08acd7e9fae";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyexcel-webio flask
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
}
|
@ -1,8 +1,5 @@
|
||||
self: super: {
|
||||
anycast_healthchecker = self.python3.pkgs.callPackage ./anycast_healthchecker {};
|
||||
flask-excel = self.python3.pkgs.callPackage ./flask-excel {};
|
||||
pyexcel-xlsx = self.python3.pkgs.callPackage ./pyexcel-xlsx {};
|
||||
pyexcel-webio = self.python3.pkgs.callPackage ./pyexcel-webio {};
|
||||
wetter = self.python3.pkgs.callPackage ./wetter {
|
||||
inherit (self) python2 pkgconfig libsass;
|
||||
};
|
||||
|
@ -1,17 +0,0 @@
|
||||
{ buildPythonPackage, fetchPypi, pyexcel }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyexcel-webio";
|
||||
version = "0.1.4";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "039538f1b35351f1632891dde29ef4d7fba744e217678ebb5a501336e28ca265";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyexcel
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{ buildPythonPackage, fetchPypi, openpyxl, pyexcel-io }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pyexcel-xlsx";
|
||||
version = "0.6.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "55754f764252461aca6871db203f4bd1370ec877828e305e6be1de5f9aa6a79d";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
openpyxl pyexcel-io
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
}
|
@ -12,14 +12,12 @@
|
||||
python2,
|
||||
python3,
|
||||
stdenv,
|
||||
flask-excel,
|
||||
pyexcel-xlsx,
|
||||
}:
|
||||
|
||||
let
|
||||
src = fetchGit {
|
||||
url = "https://git.clerie.de/clerie/wetter.git";
|
||||
rev = "bb503828098717825c389fd6f450b395a02dcc6a";
|
||||
rev = "b7134dbc0fcf44623e5adb14d1c84d07f7872844";
|
||||
};
|
||||
pname = "wetter";
|
||||
version = "0.0.1";
|
||||
@ -71,8 +69,6 @@ in buildPythonPackage rec {
|
||||
flask
|
||||
flask_sqlalchemy
|
||||
psycopg2
|
||||
flask-excel
|
||||
pyexcel-xlsx
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
@ -81,5 +77,5 @@ in buildPythonPackage rec {
|
||||
cp -r wetter/templates $out/${python3.sitePackages}/wetter/templates
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
checkPhase = ":";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user