-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshell.nix
More file actions
34 lines (34 loc) · 1.19 KB
/
shell.nix
File metadata and controls
34 lines (34 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
pkgs ? import (builtins.fetchGit {
url = "https://github.com/NixOS/nixpkgs/";
ref = "refs/tags/25.05";
}) {},
dev ? true,
pipeline ? true,
}:
let py311 = pkgs.python311.withPackages (ps: with ps; [ numpy ]);
poetryExtras = (
[ ] ++
(if dev then [ "coverage" "formatting" "linting" "pipeline" "testsuite" ] else [ ]) ++
(if pipeline then [ "pipeline" ] else [ ])
);
poetryInstallExtras = (
if poetryExtras == [] then ""
else pkgs.lib.concatStrings [ " --with " (pkgs.lib.concatStringsSep "," poetryExtras) ]
);
in
pkgs.mkShell {
name = "illumifix-env";
buildInputs = [ pkgs.poetry ];
shellHook = ''
# To get this working on the lab machine, we need to modify Poetry's keyring interaction:
# https://stackoverflow.com/questions/74438817/poetry-failed-to-unlock-the-collection
# https://github.com/python-poetry/poetry/issues/1917
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
poetry env use "${py311}/bin/python"
installcmd="poetry install -vvvv --sync${poetryInstallExtras}"
echo "Running installation command: $installcmd"
eval "$installcmd"
source "$(poetry env info --path)/bin/activate"
'';
}