-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
57 lines (50 loc) · 1.4 KB
/
default.nix
File metadata and controls
57 lines (50 loc) · 1.4 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# An example package with dependencies defined via pyproject.toml
{
config,
lib,
dream2nix,
...
}: let
pyproject = lib.importTOML (config.mkDerivation.src + /pyproject.toml);
in {
imports = [
dream2nix.modules.dream2nix.pip
];
deps = {nixpkgs, ...}: {
python = nixpkgs.python312;
};
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 = [
"workout_db"
];
};
paths.lockFile = "lock.${config.deps.stdenv.system}.json";
pip = {
# Setting editables.$pkg to a relative or absolute path, as a string, will
# link this path as an editable install to .dream2nix/editables in
# devShells. The root package is always installed as editable.
# editables.charset-normalizer = "/home/my-user/src/charset-normalizer";
requirementsList =
pyproject.build-system.requires
or []
++ pyproject.project.dependencies;
flattenDependencies = true;
overrides.click = {
buildPythonPackage.pyproject = true;
mkDerivation.nativeBuildInputs = [config.deps.python.pkgs.flit-core];
};
};
}