flake.nix: use finalPackage instead of passing it manually

This commit is contained in:
Someone Serge 2023-12-24 18:15:25 +00:00
parent 8364cf4d0b
commit 0607e24ec2
No known key found for this signature in database
GPG key ID: 7B0E3B1390D61DA4
2 changed files with 6 additions and 6 deletions

View file

@ -2,9 +2,7 @@
concatMapAttrs concatMapAttrs
(name: package: { (name: package: {
${name} = package.passthru.shell.overrideAttrs (prevAttrs: { inputsFrom = [ package ]; }); ${name} = package.passthru.shell;
${name + "-extra"} = package.passthru.shell-extra.overrideAttrs ( ${name + "-extra"} = package.passthru.shell-extra;
prevAttrs: { inputsFrom = [ package ]; }
);
}) })
packages packages

View file

@ -91,7 +91,7 @@ let
]; ];
in in
effectiveStdenv.mkDerivation { effectiveStdenv.mkDerivation (finalAttrs: {
name = "llama.cpp"; name = "llama.cpp";
src = ../../.; src = ../../.;
meta = { meta = {
@ -171,12 +171,14 @@ effectiveStdenv.mkDerivation {
name = "default${descriptionSuffix}"; name = "default${descriptionSuffix}";
description = "contains numpy and sentencepiece"; description = "contains numpy and sentencepiece";
buildInputs = [ llama-python ]; buildInputs = [ llama-python ];
inputsFrom = [ finalAttrs.finalPackage ];
}; };
shell-extra = mkShell { shell-extra = mkShell {
name = "extra${descriptionSuffix}"; name = "extra${descriptionSuffix}";
description = "contains numpy, sentencepiece, torchWithoutCuda, and transformers"; description = "contains numpy, sentencepiece, torchWithoutCuda, and transformers";
buildInputs = [ llama-python-extra ]; buildInputs = [ llama-python-extra ];
inputsFrom = [ finalAttrs.finalPackage ];
}; };
}; };
} })