53 lines
1.1 KiB
Nix
53 lines
1.1 KiB
Nix
{
|
|
lib,
|
|
python3,
|
|
stdenvNoCC,
|
|
}: let
|
|
pythonEnv = python3.withPackages (ps: [
|
|
ps.flask
|
|
ps.gunicorn
|
|
ps.weasyprint
|
|
]);
|
|
in
|
|
stdenvNoCC.mkDerivation {
|
|
pname = "azess";
|
|
version = "0.1.0";
|
|
|
|
src = lib.fileset.toSource {
|
|
root = ../.;
|
|
fileset = lib.fileset.unions [
|
|
../app.py
|
|
../templates
|
|
../README.md
|
|
../requirements.txt
|
|
];
|
|
};
|
|
|
|
dontBuild = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin $out/share/azess
|
|
cp app.py $out/share/azess/
|
|
cp -r templates $out/share/azess/
|
|
cp README.md requirements.txt $out/share/azess/
|
|
|
|
cat > $out/bin/azess <<EOF
|
|
#!${stdenvNoCC.shell}
|
|
cd "$out/share/azess"
|
|
exec ${pythonEnv}/bin/gunicorn "\$@" app:app
|
|
EOF
|
|
chmod +x $out/bin/azess
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Internal Flask application for generating Active Directory user account PDFs";
|
|
homepage = "https://git.az-gruppe.com/AZ-Intec-GmbH/AZess";
|
|
mainProgram = "azess";
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|