wrappers: fix _module.check disablement
When passing a string to `disabledModules`, it is appended to
`modulesPath`. To avoid this, explicitly pass a `{key}` module.
Adds an assertion module to the platform-wrapper integration tests:
Failed assertions:
- Expected programs.nixvim._module.check to be true. Definitions:
- In `/nix/store/XXXX-source/flake/wrappers.nix': false
Co-authored-by: MrQubo <jakub.jakub.nowak@gmail.com>
This commit is contained in:
parent
19a4e5efa1
commit
56f95d1655
6 changed files with 25 additions and 1 deletions
|
|
@ -19,6 +19,7 @@ let
|
|||
configuration = self.lib.evalNixvim {
|
||||
modules = [
|
||||
{
|
||||
_file = __curPos.file;
|
||||
key = "<internal:nixvim-nocheck-base-eval>";
|
||||
config._module.check = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ self.inputs.nix-darwin.lib.darwinSystem {
|
|||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
imports = [
|
||||
./module-check-enabled.nix
|
||||
];
|
||||
};
|
||||
|
||||
system.stateVersion = 5;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@ self.inputs.home-manager.lib.homeManagerConfiguration {
|
|||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
imports = [
|
||||
./module-check-enabled.nix
|
||||
];
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
|
|
|
|||
14
tests/platforms/module-check-enabled.nix
Normal file
14
tests/platforms/module-check-enabled.nix
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
{
|
||||
assertions = [
|
||||
{
|
||||
assertion = config._module.check;
|
||||
message = "Expected ${options._module.check} to be true. Definitions:${lib.options.showDefs options._module.check.definitionsWithLocations}";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
@ -16,6 +16,9 @@ self.inputs.nixpkgs.lib.nixosSystem {
|
|||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
imports = [
|
||||
./module-check-enabled.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
self.nixosModules.nixvim
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ let
|
|||
baseConfiguration = extendModules {
|
||||
modules = [
|
||||
nixpkgsModule
|
||||
{ disabledModules = [ "<internal:nixvim-nocheck-base-eval>" ]; }
|
||||
{ disabledModules = [ { key = "<internal:nixvim-nocheck-base-eval>"; } ]; }
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue