-
Notifications
You must be signed in to change notification settings - Fork 2
/
python-package.nix
42 lines (42 loc) · 1.34 KB
/
python-package.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
topLevel@{ flake-parts-lib, lib, inputs, ... }: {
imports = [
inputs.flake-parts.flakeModules.flakeModules
./common.nix
./overridable-package.nix
];
flake.flakeModules.pythonPackage = {
imports = [
topLevel.config.flake.flakeModules.common
topLevel.config.flake.flakeModules.overridablePackage
];
options.perSystem = flake-parts-lib.mkPerSystemOption
(perSystem@{ pkgs, system, ... }: {
options.ml-ops.common = lib.mkOption {
type = lib.types.deferredModuleWith {
staticModules = [
(common: {
options.pythonPackage = lib.mkOption {
default = { };
type = lib.types.submoduleWith {
modules = [
{
imports = [ perSystem.config.ml-ops.overridablePackage ];
config.base-package = lib.mkDefault pkgs.python3;
}
];
};
};
config.devenvShellModule.languages.python.package =
let
self = common.config.pythonPackage.overridden-package.override {
inherit self;
};
in
self;
})
];
};
};
});
};
}