wrpll-simulation/flake.nix
morgan d92214bd4e add python dependencies and update flake
py: add requirements.txt
flake: add pip hook & update to 23.11
flake: add flake lock
2023-12-05 10:41:58 +08:00

38 lines
894 B
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
in rec {
devShell = pkgs.mkShell {
name = "WRPLL-sim";
venvDir = "./.venv";
buildInputs = with pkgs.python3Packages; [
python
numba
numpy
notebook # use jupyter notebook without missing libstdc++.so.6
venvShellHook
];
# Only run once when venv is created
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
pip install -r requirements.txt
'';
postShellHook = ''
# allow pip to install wheels
unset SOURCE_DATE_EPOCH
'';
};
}
);
}