You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/modules.nix
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -367,7 +367,14 @@ let
367
367
ifm._class==null||m._class==class
368
368
thenm
369
369
else
370
-
throw"The module ${m._fileorm.key} was imported into ${class} instead of ${m._class}."
370
+
throw''
371
+
The module `${m._fileorm.key}` (class: ${lib.strings.escapeNixStringm._class}) cannot be imported into a module evaluation that expects class ${lib.strings.escapeNixStringclass}.
372
+
373
+
Help:
374
+
- Ensure that you are importing the correct module.
375
+
- Verify that the module's `_class`, ${lib.strings.escapeNixStringm._class} matches the expected `class` ${lib.strings.escapeNixStringclass}.
376
+
- If you are using a custom class, make sure it is correctly defined and used consistently across your modules.
checkConfigError 'The module .*/module-class-is-darwin.nix was imported into nixos instead of darwin.' config.sub.nixosFail.config ./class-check.nix
546
+
checkConfigError 'The module `.*/module-class-is-darwin.nix`.*?expects class "nixos".' config.sub.nixosFail.config ./class-check.nix
547
547
548
548
# submoduleWith type merge with different class
549
549
checkConfigError 'A submoduleWith option is declared multiple times with conflicting class values "darwin" and "nixos".' config.sub.mergeFail.config ./class-check.nix
0 commit comments