provisional flasktrack commit
This commit is contained in:
parent
d3da22f488
commit
e67655e12a
@ -5,6 +5,7 @@
|
|||||||
../../lib/bootstrap.nix
|
../../lib/bootstrap.nix
|
||||||
|
|
||||||
./agenix.nix
|
./agenix.nix
|
||||||
|
./flasktrack.nix
|
||||||
./franklincce.nix
|
./franklincce.nix
|
||||||
./gitea.nix
|
./gitea.nix
|
||||||
./mail.nix
|
./mail.nix
|
||||||
|
28
boxes/netbox/flasktrack.nix
Normal file
28
boxes/netbox/flasktrack.nix
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
|
appEnv = pkgs.python3.withPackages (p: with p; [
|
||||||
|
waitress
|
||||||
|
(callPackage ../../builds/flasktrack.nix {})
|
||||||
|
]);
|
||||||
|
in {
|
||||||
|
systemd.services.flasktrack = {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
environment = {
|
||||||
|
FLASKTRACK_CREDENTIAL_LOCATION = "/etc/flasktrack-secrets.cfg";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${appEnv}/bin/waitress-serve --port=8042 flasktrack:app";
|
||||||
|
StandardOutput = "journal";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."flasktrack.beepboop.systems" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
extraConfig = ''
|
||||||
|
proxy_pass http://localhost:8042;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
23
builds/flasktrack.nix
Normal file
23
builds/flasktrack.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ python3Packages, fetchgit }:
|
||||||
|
with python3Packages;
|
||||||
|
buildPythonApplication rec {
|
||||||
|
pname = "flasktrack";
|
||||||
|
version = "1.0.0";
|
||||||
|
format = "other";
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ flask ];
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
mkdir -p $out/${pythonPackages.python.sitePackages}
|
||||||
|
cp -r ./${pname} $out/${pythonPackages.python.sitePackages}/${pname}
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
shellHook = "export FLASK_APP=${pname}";
|
||||||
|
|
||||||
|
src = fetchgit {
|
||||||
|
url = "https://git.beepboop.systems/stupidcomputer/flasktrack";
|
||||||
|
hash = "sha256-ezR+Y0ciA5+SVEOIWYUtmVxMeNpcVKXOBe1OSgYm0sA=";
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user