Commit graph

8 commits

Author SHA1 Message Date
Nicolas Pierron e07f5d2a2c Add location to declared sub-modules.
svn path=/nixpkgs/trunk/; revision=17252
2009-09-18 15:10:05 +00:00
Eelco Dolstra d7d80e8fdc * Typos.
svn path=/nixpkgs/trunk/; revision=17182
2009-09-16 11:37:07 +00:00
Nicolas Pierron 0c16b00cbd Replace the traversal of modules:
- Remove handleOptionSets which used option declarations & definitions
in the same set.
- Add a traversal of modules where "config" and "options" are traverse at
the same time.

This allow to have accruate error messages with the incriminated files
playing a role in the error.

This system add a new restriction compare to the previous system:
- A module with no structure (option definitions & option declarations
& require) should not contain any option declarations.  If such module
exists you must convert it to the following form:

{ imports = <content of the require attribute>;
  options = <set of option declarations>;
  config = <set of option definitions>;
}

svn path=/nixpkgs/trunk/; revision=17163
2009-09-15 13:36:30 +00:00
Nicolas Pierron 37ce2ca949 Handles cases where developers ""cannot"" put their initial modules in
other files.

Imports of imported attribute set are not working anymore because this
feature is hard to maintain and because this a potential source of error.

Imports are only accepted inside named modules where the system has some
control over mutual inclusion.

svn path=/nixpkgs/trunk/; revision=17144
2009-09-15 00:21:39 +00:00
Michael Raskin b98b622ef0 Fix NixOS evaluation. As I understand, configuration gets added to the list of modules as an attrSet (not as a file name). Just add a trivial check to passthrough such modules.
svn path=/nixpkgs/trunk/; revision=17116
2009-09-14 20:10:41 +00:00
Nicolas Pierron 1557cfd0c6 split moduleClosure in two parts:
* unifyModuleSyntax: handle all kind of module syntax to convert them into
  a module which has the following form:

  {
    imports = [ <paths> ];
    options = <attribute set of options declarations>;
    config = <attribute set (with properties) of option definitions>;
  }

  This function assume that there is at most one imported attribute set which
  correspond to option declarations.

* moduleClosure: handle a list of module's paths which are converted with
  the previous function to do the closure of the imports with the function
  lazyGenericClosure (which does the same as builtins.genericClosure except
  that it doesn't evaluate the content of modules).  The "key" and "paths"
  attributes are left to be used as debug information in futur
  implementation(s).

svn path=/nixpkgs/trunk/; revision=17108
2009-09-14 13:19:00 +00:00
Eelco Dolstra 80cab44fce * Options / config: these should be attrsets, not lists (IMHO).
svn path=/nixpkgs/trunk/; revision=16359
2009-07-14 16:22:42 +00:00
Nicolas Pierron b09382fcd1 Extract properties.nix and modules.nix from options.nix.
svn path=/nixpkgs/trunk/; revision=16339
2009-07-13 16:18:52 +00:00