This commit adds some logic to the modules normalization process to
allow including modules under a user-defined namespace. It achieves it
by:
- flattening any attribute sets in `includes` that are non-empty nor
contain any of a module's valid attributes (`lib.modules.VALID_KEYS`).
- Erroring out on dupplicate namespaces.
- Mapping namespaced includes do normal modules declaring an option
`${namespace}` of the include as a submodule.
This allows specifying includes in a module like:
```
{
includes.mynamespace0 = ./mymodule0.nix;
includes.mynamespace1 = ./mymodule1.nix;
}
```
and is approximatively desugared by `lib.modules.normalize` into:
```
{
includes = [
{ options.mynamespace0 = lib.submodule mymodule0.nix; }
{ options.mynamespace1 = lib.submodule mymodule1.nix; }
];
}
```
This was inspired by nixpkgs' `lib.modules.doRename`.