-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
35 lines (35 loc) · 1.01 KB
/
flake.nix
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
35
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flakeUtils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flakeUtils }:
flakeUtils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = flakeUtils.lib.flattenTree {
python39 = pkgs.python39;
python310 = pkgs.python310;
python311 = pkgs.python311;
python312 = pkgs.python312;
};
devShell = pkgs.mkShell {
buildInputs = with self.packages.${system}; [
python39
python310
python311
python312
];
shellHook = ''
[[ ! -d .venv ]] && \
echo "Creating virtualenv ..." && \
${pkgs.python39}/bin/python -m \
venv --copies --upgrade-deps .venv > /dev/null
source .venv/bin/activate
pip install --require-virtualenv --no-input tox
'';
};
});
}