provisional flasktrack commit

This commit is contained in:
stupidcomputer 2025-01-12 20:50:31 -06:00
parent d3da22f488
commit e67655e12a
3 changed files with 52 additions and 0 deletions

View File

@ -5,6 +5,7 @@
../../lib/bootstrap.nix
./agenix.nix
./flasktrack.nix
./franklincce.nix
./gitea.nix
./mail.nix

View 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
View 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=";
};
}