Skip to content

Commit 0710b45

Browse files
committed
Add nix develop shell
1 parent a06e1b6 commit 0710b45

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

flake.lock

+27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
description = "python development environment";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs =
9+
{ self, nixpkgs, ... }@inputs:
10+
let
11+
system = "x86_64-linux";
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
in
14+
{
15+
devShells.x86_64-linux.default = pkgs.mkShell {
16+
venvDir = "./venv";
17+
nativeBuildInputs = with pkgs; [
18+
python312
19+
python312Packages.venvShellHook
20+
];
21+
22+
shellHook = '''';
23+
24+
# Run this command, only after creating the virtual environment
25+
postVenvCreation = ''
26+
unset SOURCE_DATE_EPOCH
27+
pip install -r requirements.txt
28+
'';
29+
30+
# Now we can execute any commands within the virtual environment.
31+
# This is optional and can be left out to run pip manually.
32+
postShellHook = ''
33+
# allow pip to install wheels
34+
unset SOURCE_DATE_EPOCH
35+
'';
36+
};
37+
};
38+
}

0 commit comments

Comments
 (0)