This commit is contained in:
Lennart J. Kurzweg (Nx2)
2024-08-02 16:53:23 +02:00
commit 0b0c326804
7 changed files with 1957 additions and 0 deletions

35
shell.nix Normal file
View File

@@ -0,0 +1,35 @@
{ pkgs ? import <nixpkgs> { } }:
let
my-python = pkgs.python312;
python-with-my-packages = my-python.withPackages
(p: with p; [
]);
lib-path = with pkgs; lib.makeLibraryPath [
libffi
openssl
stdenv.cc.cc
];
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
'';
}