Skip to content

Commit

Permalink
build: making dev shell with nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
minghongx committed Jan 13, 2024
1 parent 30f4c8d commit a06b17a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ __pycache__/

# Distribution / packaging
dist/

# Virtual environments
.venv
38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
description = "SNNCutoff's development environment";

inputs = {
utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
utils,
...
}:
utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
pypkgs = pkgs.python3Packages;
in {
devShells.default = pkgs.mkShell {
venvDir = "./.venv";
buildInputs = [
pypkgs.python
pypkgs.venvShellHook # creates a venv in $venvDir
];

postVenvCreation = ''
python -m pip install --editable .[dev]
'';

postShellHook = ''
'';

# Enable python libraries to discover libstdc++.so.6
LD_LIBRARY_PATH = with pkgs; lib.makeLibraryPath [ stdenv.cc.cc ];
};
});
}

0 comments on commit a06b17a

Please sign in to comment.