-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
55 lines (48 loc) · 1.08 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{
config,
lib,
dream2nix,
...
}: let
pyproject = lib.importTOML (config.mkDerivation.src + /pyproject.toml); #
in {
imports = [
dream2nix.modules.dream2nix.pip #
];
deps = {nixpkgs, ...}: {
python = nixpkgs.python3; #
};
inherit (pyproject.project) name version; #
mkDerivation = {
src = lib.cleanSourceWith { #
src = lib.cleanSource ./.;
filter = name: type:
!(builtins.any (x: x) [
(lib.hasSuffix ".nix" name)
(lib.hasPrefix "." (builtins.baseNameOf name))
(lib.hasSuffix "flake.lock" name)
]);
};
};
buildPythonPackage = {
pyproject = true; #
pythonImportsCheck = [ #
"citrine"
# "numba"
"numpy"
"matplotlib"
"PyQt6"
];
};
pip = {
#
requirementsList =
pyproject.build-system.requires or []
++ pyproject.project.dependencies or [];
flattenDependencies = true; #
overrides.click = { #
buildPythonPackage.pyproject = true;
mkDerivation.nativeBuildInputs = [config.deps.python.pkgs.flit-core];
};
};
}