初始化
This commit is contained in:
39
flake.nix
Normal file
39
flake.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
description = "MaiMBot Nix Dev Env";
|
||||
|
||||
inputs = {
|
||||
utils.url = "github:numtide/flake-utils";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
utils,
|
||||
...
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {inherit system;};
|
||||
pythonPackages = pkgs.python3Packages;
|
||||
in {
|
||||
devShells.default = pkgs.mkShell {
|
||||
name = "python-venv";
|
||||
venvDir = "./.venv";
|
||||
buildInputs = with pythonPackages; [
|
||||
python
|
||||
venvShellHook
|
||||
scipy
|
||||
numpy
|
||||
];
|
||||
|
||||
postVenvCreation = ''
|
||||
unset SOURCE_DATE_EPOCH
|
||||
pip install -r requirements.txt
|
||||
'';
|
||||
|
||||
postShellHook = ''
|
||||
# allow pip to install wheels
|
||||
unset SOURCE_DATE_EPOCH
|
||||
'';
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user