mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-02 06:44:56 +03:00
37 lines
794 B
Nix
37 lines
794 B
Nix
{
|
|
config,
|
|
lib,
|
|
options,
|
|
...
|
|
}: let
|
|
l = lib // builtins;
|
|
cfg = config.nixpkgs-overrides;
|
|
|
|
excludedNixpkgsAttrs =
|
|
l.genAttrs cfg.excludedNixpkgsAttrs (name: null);
|
|
|
|
extractOverrideAttrs = overrideFunc:
|
|
(overrideFunc (old: {passthru.old = old;}))
|
|
.old;
|
|
|
|
extractPythonAttrs = pythonPackage: let
|
|
pythonAttrs = extractOverrideAttrs pythonPackage.overridePythonAttrs;
|
|
in
|
|
l.filterAttrs (name: _: ! excludedNixpkgsAttrs ? ${name}) pythonAttrs;
|
|
|
|
extracted = extractPythonAttrs config.deps.python.pkgs.${config.public.name};
|
|
in {
|
|
imports = [
|
|
./interface.nix
|
|
];
|
|
|
|
config = l.mkMerge [
|
|
(l.mkIf cfg.enable {
|
|
package-func.args = extracted;
|
|
})
|
|
{
|
|
nixpkgs-overrides.lib = {inherit extractOverrideAttrs extractPythonAttrs;};
|
|
}
|
|
];
|
|
}
|