build(nix): Refactor gguf-py derivation to take in exact deps
This commit is contained in:
parent
0b8ddf8694
commit
11e581b45d
2 changed files with 16 additions and 5 deletions
|
@ -1,15 +1,17 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
llamaVersion,
|
llamaVersion,
|
||||||
python3,
|
numpy,
|
||||||
|
poetry-core,
|
||||||
|
buildPythonPackage,
|
||||||
}@inputs:
|
}@inputs:
|
||||||
|
|
||||||
python3.pkgs.buildPythonPackage rec {
|
buildPythonPackage {
|
||||||
pname = "gguf";
|
pname = "gguf";
|
||||||
version = llamaVersion;
|
version = llamaVersion;
|
||||||
pyproject = true;
|
pyproject = true;
|
||||||
nativeBuildInputs = with python3.pkgs; [ poetry-core ];
|
nativeBuildInputs = [ poetry-core ];
|
||||||
propagatedBuildInputs = with python3.pkgs; [ numpy ];
|
propagatedBuildInputs = [ numpy ];
|
||||||
src = lib.cleanSource ../../gguf-py;
|
src = lib.cleanSource ../../gguf-py;
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
|
@ -1,16 +1,25 @@
|
||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
newScope,
|
newScope,
|
||||||
|
python3,
|
||||||
llamaVersion ? "0.0.0",
|
llamaVersion ? "0.0.0",
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
pythonPackages = python3.pkgs;
|
||||||
|
buildPythonPackage = pythonPackages.buildPythonPackage;
|
||||||
|
numpy = pythonPackages.numpy;
|
||||||
|
poetry-core = pythonPackages.poetry-core;
|
||||||
|
in
|
||||||
|
|
||||||
# We're using `makeScope` instead of just writing out an attrset
|
# We're using `makeScope` instead of just writing out an attrset
|
||||||
# because it allows users to apply overlays later using `overrideScope'`.
|
# because it allows users to apply overlays later using `overrideScope'`.
|
||||||
# Cf. https://noogle.dev/f/lib/makeScope
|
# Cf. https://noogle.dev/f/lib/makeScope
|
||||||
|
|
||||||
lib.makeScope newScope (self: {
|
lib.makeScope newScope (self: {
|
||||||
inherit llamaVersion;
|
inherit llamaVersion;
|
||||||
gguf-py = self.callPackage ./package-gguf-py.nix { };
|
pp = python3.pkgs;
|
||||||
|
gguf-py = self.callPackage ./package-gguf-py.nix { inherit buildPythonPackage numpy poetry-core; };
|
||||||
llama-cpp = self.callPackage ./package.nix { };
|
llama-cpp = self.callPackage ./package.nix { };
|
||||||
docker = self.callPackage ./docker.nix { };
|
docker = self.callPackage ./docker.nix { };
|
||||||
docker-min = self.callPackage ./docker.nix { interactive = false; };
|
docker-min = self.callPackage ./docker.nix { interactive = false; };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue