fixed python packages AGAIN
This commit is contained in:
parent
702ce20cf6
commit
0ade2c3962
3 changed files with 85 additions and 2 deletions
|
|
@ -3,10 +3,12 @@
|
|||
prev,
|
||||
lib,
|
||||
forFlakeOutputs ? false,
|
||||
forPythonScope ? false,
|
||||
...
|
||||
}:
|
||||
let
|
||||
dirs = path: lib.attrNames (lib.filterAttrs (_: t: t == "directory") (builtins.readDir path));
|
||||
pythonPackagesDir = ./by-category/pythonPackages;
|
||||
|
||||
packagesFromTree =
|
||||
base: callPackage:
|
||||
|
|
@ -48,5 +50,38 @@ let
|
|||
};
|
||||
|
||||
overlayAttrs = byNamePkgs // byCategoryPkgs;
|
||||
directFlakePackages = lib.filterAttrs (_: lib.isDerivation) overlayAttrs;
|
||||
|
||||
flakePythonPackages =
|
||||
let
|
||||
pyPkgs = if pkgs ? python313Packages then pkgs.python313Packages else pkgs.python3Packages;
|
||||
treePkgs =
|
||||
if builtins.pathExists pythonPackagesDir then
|
||||
removeAttrs (packagesFromTree pythonPackagesDir pyPkgs.callPackage) [
|
||||
"python-packages"
|
||||
]
|
||||
else
|
||||
{ };
|
||||
prefabPkgs =
|
||||
if builtins.pathExists (pythonPackagesDir + "/prefab-builder.nix") then
|
||||
prev.lib.customisation.callPackagesWith (
|
||||
pyPkgs
|
||||
// {
|
||||
lib = prev.lib;
|
||||
pkgs = prev;
|
||||
pyPkgs = pyPkgs;
|
||||
fetchFromGitHub = prev.fetchFromGitHub;
|
||||
fetchPypi = prev.fetchPypi;
|
||||
}
|
||||
) (pythonPackagesDir + "/prefab-builder.nix") { }
|
||||
else
|
||||
{ };
|
||||
in
|
||||
treePkgs // prefabPkgs;
|
||||
in
|
||||
if forFlakeOutputs then lib.filterAttrs (_: lib.isDerivation) overlayAttrs else overlayAttrs
|
||||
if forPythonScope then
|
||||
flakePythonPackages
|
||||
else if forFlakeOutputs then
|
||||
directFlakePackages
|
||||
else
|
||||
overlayAttrs
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue