forked from fediversity/fediversity
48 lines
1.2 KiB
Nix
48 lines
1.2 KiB
Nix
/**
|
|
Collection of locally provided Python packages.
|
|
|
|
Add packages by creating a directory containing a `default.nix` file.
|
|
The directory name will be used for the attribute name in package set.
|
|
|
|
A package crecipe can use Python packages in its argument directly, e.g.
|
|
|
|
```nix
|
|
{ fetchFromGitHub, buildPythonPackage, django_4 }:
|
|
{
|
|
# ...
|
|
}
|
|
```
|
|
*/
|
|
{
|
|
pkgs,
|
|
sources ? import ../../../npins,
|
|
}:
|
|
let
|
|
callPackage = pkgs.lib.callPackageWith (pkgs // pkgs.python3.pkgs // extraPython3Packages);
|
|
|
|
extraPython3Packages =
|
|
let
|
|
dir = toString ./.;
|
|
in
|
|
with builtins;
|
|
(
|
|
{
|
|
django-pydantic-field =
|
|
pkgs.callPackage
|
|
"${sources.nixpkgs-unstable}/pkgs/development/python-modules/django-pydantic-field/default.nix"
|
|
{ };
|
|
drf-pydantic =
|
|
pkgs.callPackage
|
|
"${sources.nixpkgs-unstable}/pkgs/development/python-modules/drf-pydantic/default.nix"
|
|
{ };
|
|
}
|
|
# will read further packages from sub-dirs here
|
|
// listToAttrs (
|
|
map (name: {
|
|
inherit name;
|
|
value = callPackage (dir + "/${name}") { };
|
|
}) (attrNames (readDir dir))
|
|
)
|
|
);
|
|
in
|
|
extraPython3Packages
|