mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-01 06:31:05 +01:00
lib: move enableExceptInTests impl to build.test option
Simplify the `enableExceptInTests` attribute, removing the `_nixvimTests` argument. We now do a full re-eval of the nixvim configuration before building the test, giving us a central place to implement `enableExceptInTests` and its eventual replacement(s). This extends support for `enableExceptInTests` to all methods of getting a nixvim test derivation. Previously, it only worked when using `mkTestDerivationFromNixvimModule`. In `tests/main.nix`, we avoid the re-eval by doing the initial eval with a "test mode" lib from the start.
This commit is contained in:
parent
7754b4eb1b
commit
8d0ca9abc4
7 changed files with 57 additions and 31 deletions
|
|
@ -9,14 +9,10 @@
|
|||
# NOTE: `defaultSystem` is the only reason this function can't go in `<nixvim>.lib`
|
||||
system ? defaultSystem,
|
||||
extraSpecialArgs ? { },
|
||||
_nixvimTests ? false,
|
||||
module,
|
||||
}:
|
||||
let
|
||||
# NOTE: we are importing this just for evalNixvim
|
||||
helpers = self.lib.nixvim.override { inherit _nixvimTests; };
|
||||
inherit (helpers.modules) evalNixvim;
|
||||
|
||||
systemMod =
|
||||
if pkgs == null then
|
||||
{
|
||||
|
|
@ -33,7 +29,7 @@ let
|
|||
mod:
|
||||
let
|
||||
modules = lib.toList mod;
|
||||
nixvimConfig = evalNixvim {
|
||||
nixvimConfig = self.lib.evalNixvim {
|
||||
modules = modules ++ [
|
||||
systemMod
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue