2023-11-16 11:53:22 +08:00
|
|
|
{
|
|
|
|
inputs = {
|
2023-12-05 10:41:58 +08:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
2023-11-16 11:53:22 +08:00
|
|
|
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";
|
2023-12-05 10:41:58 +08:00
|
|
|
venvDir = "./.venv";
|
|
|
|
buildInputs = with pkgs.python3Packages; [
|
|
|
|
python
|
|
|
|
numba
|
|
|
|
numpy
|
|
|
|
notebook # use jupyter notebook without missing libstdc++.so.6
|
|
|
|
venvShellHook
|
2023-11-16 11:53:22 +08:00
|
|
|
];
|
2023-12-05 10:41:58 +08:00
|
|
|
|
|
|
|
# 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
|
|
|
|
'';
|
|
|
|
|
2023-11-16 11:53:22 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|