51 lines
1.1 KiB
Nix
51 lines
1.1 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
dream2nix,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
pyproject = lib.importTOML (config.mkDerivation.src + /pyproject.toml);
|
|
in rec {
|
|
imports = [
|
|
dream2nix.modules.dream2nix.pip
|
|
];
|
|
|
|
inherit (pyproject.project) name version;
|
|
|
|
deps = {nixpkgs, ...}: {
|
|
python = nixpkgs.python310;
|
|
inherit (nixpkgs) openssl;
|
|
};
|
|
|
|
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 = [
|
|
"hcpy"
|
|
];
|
|
};
|
|
|
|
pip = {
|
|
# requirementsList = lib.splitString "\n" (builtins.readFile (config.mkDerivation.src + /requirements.txt));
|
|
requirementsList =
|
|
pyproject.build-system.requires
|
|
or []
|
|
++ pyproject.project.dependencies or [];
|
|
flattenDependencies = true;
|
|
|
|
overrides.sslpsk.mkDerivation.buildInputs = [config.deps.openssl];
|
|
};
|
|
}
|