mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 08:35:43 +02:00
test/nixpkgs-module: use a fixed runCommand
function
Rather than getting `runCommand` from the pkgs instance under test, get the function from a fixed/consistent pkgs instance.
This commit is contained in:
parent
7854d5f18c
commit
5192a85f32
2 changed files with 19 additions and 1 deletions
|
@ -169,6 +169,22 @@ in
|
||||||
'';
|
'';
|
||||||
internal = true;
|
internal = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Primarily intended for internal use, allowing us to test `pkgs` while using a `runCommand` from a different nixpkgs instance.
|
||||||
|
runCommand = lib.mkOption {
|
||||||
|
type =
|
||||||
|
with lib.types;
|
||||||
|
addCheck unspecified builtins.isFunction
|
||||||
|
// {
|
||||||
|
description = "runCommand function";
|
||||||
|
};
|
||||||
|
description = ''
|
||||||
|
`runCommand` function used to construct `build.test`.
|
||||||
|
'';
|
||||||
|
defaultText = lib.literalExpression "pkgs.runCommandLocal";
|
||||||
|
default = pkgs.runCommandLocal;
|
||||||
|
internal = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
options.build = {
|
options.build = {
|
||||||
|
@ -238,7 +254,7 @@ in
|
||||||
|
|
||||||
build.test =
|
build.test =
|
||||||
assert lib.assertMsg (cfg.runNvim -> cfg.buildNixvim) "`test.runNvim` requires `test.buildNixvim`.";
|
assert lib.assertMsg (cfg.runNvim -> cfg.buildNixvim) "`test.runNvim` requires `test.buildNixvim`.";
|
||||||
pkgs.runCommandLocal cfg.name
|
cfg.runCommand cfg.name
|
||||||
{
|
{
|
||||||
nativeBuildInputs = lib.optionals cfg.buildNixvim [
|
nativeBuildInputs = lib.optionals cfg.buildNixvim [
|
||||||
config.build.packageUnchecked
|
config.build.packageUnchecked
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
linkFarmFromDrvs,
|
linkFarmFromDrvs,
|
||||||
self,
|
self,
|
||||||
stdenv,
|
stdenv,
|
||||||
|
runCommandLocal,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
||||||
|
@ -19,6 +20,7 @@ let
|
||||||
inherit name;
|
inherit name;
|
||||||
buildNixvim = false;
|
buildNixvim = false;
|
||||||
runNvim = false;
|
runNvim = false;
|
||||||
|
runCommand = runCommandLocal;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue