nix-plugin-pijul.tests: fix the eval

Without the change the eval fails as:

    $ nix build --no-link -f. nix-plugin-pijul.tests
    error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:34:12:
           33|
           34|   strict = derivationStrict drvAttrs;
             |            ^
           35|

       … while evaluating derivation 'localRepoCheck-nix-2.25.0pre20240920_ca3fc169'
         whose name attribute is located at pkgs/stdenv/generic/make-derivation.nix:336:7

       … while evaluating attribute 'buildCommand' of derivation 'localRepoCheck-nix-2.25.0pre20240920_ca3fc169'
         at pkgs/build-support/trivial-builders/default.nix:59:17:
           58|         enableParallelBuilding = true;
           59|         inherit buildCommand name;
             |                 ^
           60|         passAsFile = [ "buildCommand" ]

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: function 'anonymous lambda' called with unexpected argument 'nix'
       at pkgs/by-name/ni/nix-plugin-pijul/package.nix:1:1:
            1| {
             | ^
            2|   lib,
       Did you mean lib?
This commit is contained in:
Sergei Trofimovich 2024-10-05 16:31:58 +01:00
parent 8861008db8
commit 5968299b95

View File

@ -11,9 +11,11 @@
runCommand,
pijul,
nixVersions,
nixOverride ? null,
nix-plugin-pijul,
}:
stdenv.mkDerivation (finalAttrs: {
let nix = if nixOverride != null then nixOverride else nixVersions.nix_2_18;
in stdenv.mkDerivation (finalAttrs: {
pname = "nix-plugin-pijul";
version = "0.1.4";
@ -30,12 +32,12 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [
boost
howard-hinnant-date
nixVersions.nix_2_18
nix
];
passthru.tests = let
localRepoCheck = nix:
runCommand "localRepoCheck-${nix.name}"
localRepoCheck = nixOverride:
runCommand "localRepoCheck-${nixOverride.name}"
{
nativeBuildInputs = [
pijul
@ -56,7 +58,7 @@ stdenv.mkDerivation (finalAttrs: {
output=$(
nix \
--option plugin-files ${nix-plugin-pijul.override {inherit nix;}}/lib/nix/plugins/pijul.so \
--option plugin-files ${nix-plugin-pijul.override {inherit nixOverride;}}/lib/nix/plugins/pijul.so \
--extra-experimental-features 'nix-command flakes' \
eval --impure --raw --expr "builtins.readFile ((builtins.fetchTree \"pijul+file://$PWD\") + \"/foo\")"
)