nixos: Try to show an helpful message when the user sets config. or options.

Feel free to improve or remove :-)
This commit is contained in:
Luca Bruno 2014-11-01 23:29:38 +01:00
parent 0bba805fa6
commit 350fa1f775

View File

@ -58,7 +58,7 @@ rec {
if m ? config || m ? options then if m ? config || m ? options then
let badAttrs = removeAttrs m ["imports" "options" "config" "key" "_file"]; in let badAttrs = removeAttrs m ["imports" "options" "config" "key" "_file"]; in
if badAttrs != {} then if badAttrs != {} then
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'." throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by assignments to the top-level attributes `config' or `options'."
else else
{ file = m._file or file; { file = m._file or file;
key = toString m.key or key; key = toString m.key or key;