Files
hcpy/package.nix
2024-11-21 15:48:53 +01:00

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];
};
}