This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-08-16 19:28:51 +02:00
commit 9d75757fec
20 changed files with 287594 additions and 0 deletions

32
app/shell.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs ? import <nixpkgs> { } }:
let
my-python = pkgs.python312;
python-with-my-packages = my-python.withPackages
(p: with p; [
# flask
]);
lib-path = with pkgs; lib.makeLibraryPath [
];
in pkgs.mkShell {
buildInputs = [
python-with-my-packages
];
shellHook = ''
SOURCE_DATE_EPOCH=$(date +%s)
export "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${lib-path}"
VENV=.venv
if test ! -d $VENV; then
python3 -m venv $VENV
fi
source ./$VENV/bin/activate
export PYTHONPATH=`pwd`/$VENV/${python-with-my-packages.sitePackages}/
# export PYTHONPATH=`pwd`/$VENV/${python-with-my-packages.sitePackages}/:$PYTHONPATH
pip install -r requirements.txt
'';
postShellHook = ''
ln -sf ${python-with-my-packages.sitePackages}/* ./.venv/lib/python3.12/site-packages
'';
}