Skip to content

Commit 4957125

Browse files
committed
build(nix): Refactor gguf-py derivation to take in exact deps
1 parent 9f6aa95 commit 4957125

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.devops/nix/package-gguf-py.nix

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
{
22
lib,
33
llamaVersion,
4-
python3,
4+
numpy,
5+
poetry-core,
6+
buildPythonPackage,
57
}@inputs:
68

7-
python3.pkgs.buildPythonPackage rec {
9+
buildPythonPackage {
810
pname = "gguf";
911
version = llamaVersion;
1012
pyproject = true;
11-
nativeBuildInputs = with python3.pkgs; [ poetry-core ];
12-
propagatedBuildInputs = with python3.pkgs; [ numpy ];
13+
nativeBuildInputs = [ poetry-core ];
14+
propagatedBuildInputs = [ numpy ];
1315
src = lib.cleanSource ../../gguf-py;
1416
doCheck = false;
1517
meta = with lib; {

.devops/nix/scope.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
{
22
lib,
33
newScope,
4+
python3,
45
llamaVersion ? "0.0.0",
56
}:
67

8+
let
9+
pythonPackages = python3.pkgs;
10+
buildPythonPackage = pythonPackages.buildPythonPackage;
11+
numpy = pythonPackages.numpy;
12+
poetry-core = pythonPackages.poetry-core;
13+
in
14+
715
# We're using `makeScope` instead of just writing out an attrset
816
# because it allows users to apply overlays later using `overrideScope'`.
917
# Cf. https://noogle.dev/f/lib/makeScope
1018

1119
lib.makeScope newScope (self: {
1220
inherit llamaVersion;
13-
gguf-py = self.callPackage ./package-gguf-py.nix { };
21+
pp = python3.pkgs;
22+
gguf-py = self.callPackage ./package-gguf-py.nix { inherit buildPythonPackage; };
1423
llama-cpp = self.callPackage ./package.nix { };
1524
docker = self.callPackage ./docker.nix { };
1625
docker-min = self.callPackage ./docker.nix { interactive = false; };

0 commit comments

Comments
 (0)