about summary refs log tree commit diff
path: root/lib/tests/modules.sh
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-02-07 20:51:17 +0100
committerRobert Hensing <robert@roberthensing.nl>2023-05-06 18:29:03 +0200
commit2e689d58cbbe6b7047bb132dc79097016e606dd0 (patch)
treef9b5b7b15606344db2fe3a70076b6f3df625bb51 /lib/tests/modules.sh
parent58f385f68005a6fed7b526ee2c19fef11d87038c (diff)
downloadnixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.tar
nixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.tar.gz
nixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.tar.bz2
nixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.tar.lz
nixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.tar.xz
nixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.tar.zst
nixlib-2e689d58cbbe6b7047bb132dc79097016e606dd0.zip
lib/modules: Improve error when a configuration is imported
This is appears to be a fairly common mistake for beginners who want
to build larger things from the system configurations, such as NixOps
networks, etc. Further explanation seems appropriate.
Diffstat (limited to 'lib/tests/modules.sh')
-rwxr-xr-xlib/tests/modules.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/tests/modules.sh b/lib/tests/modules.sh
index 4da0cb38f685..d12e503c4b1d 100755
--- a/lib/tests/modules.sh
+++ b/lib/tests/modules.sh
@@ -368,6 +368,7 @@ checkConfigError 'The module foo.nix#darwinModules.default was imported into nix
 # _type check
 checkConfigError 'Could not load a value as a module, because it is of type "flake", in file .*/module-imports-_type-check.nix' config.ok.config ./module-imports-_type-check.nix
 checkConfigOutput '^true$' "$@" config.enable ./declare-enable.nix ./define-enable-with-top-level-mkIf.nix
+checkConfigError 'Could not load a value as a module, because it is of type "configuration", in file .*/import-configuration.nix' config ./import-configuration.nix
 
 # doRename works when `warnings` does not exist.
 checkConfigOutput '^1234$' config.c.d.e ./doRename-basic.nix