Skip to content

Commit ac58e93

Browse files
authored
nix: use default python version for nix dev environment (#5672)
This is a follow-up of #5671.
1 parent e0cae00 commit ac58e93

File tree

1 file changed

+33
-38
lines changed

1 file changed

+33
-38
lines changed

flake.nix

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,39 @@
2121

2222
packages.grass = pkgs.callPackage ./package.nix { };
2323

24-
devShells.default =
25-
let
26-
pyPackages = pkgs.python312Packages;
27-
28-
in
29-
pkgs.mkShell {
30-
inputsFrom = [ self'.packages.grass ];
31-
32-
# additional packages
33-
buildInputs = with pyPackages; [
34-
pytest
35-
];
36-
37-
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
38-
39-
shellHook = ''
40-
function dev-help {
41-
echo -e "\nWelcome to a GRASS development environment !"
42-
echo "Build GRASS using following commands:"
43-
echo
44-
echo " 1. ./configure --prefix=\$(pwd)/app"
45-
echo " 2. make -j$(nproc)"
46-
echo " 3. make install"
47-
echo
48-
echo "Run tests:"
49-
echo
50-
echo " 1. export PYTHONPATH=\$(app/bin/grass --config python_path):\$PYTHONPATH"
51-
echo " 2. export LD_LIBRARY_PATH=\$(app/bin/grass --config path)/lib:\$LD_LIBRARY_PATH"
52-
echo " 3. pytest"
53-
echo
54-
echo "Note: run 'nix flake update' from time to time to update dependencies."
55-
echo
56-
echo "Run 'dev-help' to see this message again."
57-
}
58-
59-
dev-help
60-
'';
61-
};
24+
devShells.default = pkgs.mkShell {
25+
inputsFrom = [ self'.packages.grass ];
26+
27+
# additional packages
28+
buildInputs = with pkgs.python3Packages; [
29+
pytest
30+
];
31+
32+
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
33+
34+
shellHook = ''
35+
function dev-help {
36+
echo -e "\nWelcome to a GRASS development environment !"
37+
echo "Build GRASS using following commands:"
38+
echo
39+
echo " 1. ./configure --prefix=\$(pwd)/app"
40+
echo " 2. make -j$(nproc)"
41+
echo " 3. make install"
42+
echo
43+
echo "Run tests:"
44+
echo
45+
echo " 1. export PYTHONPATH=\$(app/bin/grass --config python_path):\$PYTHONPATH"
46+
echo " 2. export LD_LIBRARY_PATH=\$(app/bin/grass --config path)/lib:\$LD_LIBRARY_PATH"
47+
echo " 3. pytest"
48+
echo
49+
echo "Note: run 'nix flake update' from time to time to update dependencies."
50+
echo
51+
echo "Run 'dev-help' to see this message again."
52+
}
53+
54+
dev-help
55+
'';
56+
};
6257
};
6358

6459
flake = { };

0 commit comments

Comments
 (0)