-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequirements.nix
69 lines (60 loc) · 2.1 KB
/
requirements.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# generated using pypi2nix tool (version: 1.6.0)
# See more at: https://github.com/garbas/pypi2nix
#
# COMMAND:
# pypi2nix -V 2.7 -e mkdocs
#
{ pkgs ? import <nixpkgs> {}
}:
let
inherit (pkgs) makeWrapper;
inherit (pkgs.stdenv.lib) fix' extends inNixShell;
pythonPackages = import "${toString pkgs.path}/pkgs/top-level/python-packages.nix" {
inherit pkgs;
inherit (pkgs) stdenv;
python = pkgs.python27Full;
self = pythonPackages;
};
commonBuildInputs = [];
commonDoCheck = false;
withPackages = pkgs':
let
pkgs = builtins.removeAttrs pkgs' ["__unfix__"];
interpreter = pythonPackages.buildPythonPackage {
name = "python27Full-interpreter";
buildInputs = [ makeWrapper ] ++ (builtins.attrValues pkgs);
buildCommand = ''
mkdir -p $out/bin
ln -s ${pythonPackages.python.interpreter} $out/bin/${pythonPackages.python.executable}
for dep in ${builtins.concatStringsSep " " (builtins.attrValues pkgs)}; do
if [ -d "$dep/bin" ]; then
for prog in "$dep/bin/"*; do
if [ -f $prog ]; then
ln -s $prog $out/bin/`basename $prog`
fi
done
fi
done
for prog in "$out/bin/"*; do
wrapProgram "$prog" --prefix PYTHONPATH : "$PYTHONPATH"
done
pushd $out/bin
ln -s ${pythonPackages.python.executable} python
popd
'';
passthru.interpreter = pythonPackages.python;
};
in {
__old = pythonPackages;
inherit interpreter;
mkDerivation = pythonPackages.buildPythonPackage;
packages = pkgs;
overrideDerivation = drv: f:
pythonPackages.buildPythonPackage (drv.drvAttrs // f drv.drvAttrs);
withPackages = pkgs'':
withPackages (pkgs // pkgs'');
};
python = withPackages {};
generated = import ./requirements_generated.nix { inherit pkgs python commonBuildInputs commonDoCheck; };
overrides = import ./requirements_override.nix { inherit pkgs python; };
in python.withPackages (fix' (extends overrides generated))