mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-16 04:04:34 +02:00
modules/test: allow not building nixvim config
This commit is contained in:
parent
1671f8618f
commit
e7dcc9b518
1 changed files with 12 additions and 2 deletions
|
@ -19,10 +19,17 @@ in
|
|||
description = "The test derivation's name.";
|
||||
};
|
||||
|
||||
buildNixvim = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Whether to build the nixvim config in the test.";
|
||||
default = true;
|
||||
};
|
||||
|
||||
runNvim = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Whether to run `nvim` in the test.";
|
||||
default = true;
|
||||
defaultText = lib.literalExpression "config.test.buildNixvim";
|
||||
default = cfg.buildNixvim;
|
||||
};
|
||||
|
||||
checkWarnings = lib.mkOption {
|
||||
|
@ -68,9 +75,12 @@ in
|
|||
in
|
||||
{
|
||||
build.test =
|
||||
assert lib.assertMsg (cfg.runNvim -> cfg.buildNixvim) "`test.runNvim` requires `test.buildNixvim`.";
|
||||
pkgs.runCommandNoCCLocal cfg.name
|
||||
{
|
||||
nativeBuildInputs = [ config.build.packageUnchecked ];
|
||||
nativeBuildInputs = lib.optionals cfg.buildNixvim [
|
||||
config.build.packageUnchecked
|
||||
];
|
||||
|
||||
# Allow inspecting the test's module a little from the repl
|
||||
# e.g.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue