-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
33 lines (26 loc) · 1008 Bytes
/
default.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
{ pkgs ? import ./nix {}
, pythonPackages ? "python38Packages"
}:
let
inherit (pkgs.lib) fix extends;
basePythonPackages = with builtins; if isAttrs pythonPackages
then pythonPackages
else getAttr pythonPackages pkgs;
pythonPackagesGenerated = pkgs.callPackage ./nix/python-packages.nix {};
pythonPackagesOverrides = pkgs.callPackage ./nix/python-packages-overrides.nix { inherit basePythonPackages; };
# extract package name, version & dependencies from setup.cfg
setupcfg = import (pkgs.runCommand "setup.cfg" {} ''${pkgs.setupcfg2nix}/bin/setupcfg2nix ${./setup.cfg} > $out'');
pythonPackagesLocalOverrides = self: super: {
hello = super.buildSetupcfg {
info = setupcfg;
src = pkgs.gitignoreSource ./.;
application = true;
};
};
myPythonPackages =
(fix
(extends pythonPackagesLocalOverrides
(extends pythonPackagesOverrides
(extends pythonPackagesGenerated
basePythonPackages.__unfix__))));
in myPythonPackages.hello