Define modules as paths to functions, not functions

This is to avoid conflicts when imported from multiple locations.

Example: Module nur.repos.foo.modules.bar defines an option.
If nur.repos.foo.modules.bar is a function, importing it from
multiple places will result in defining the option multiple times,
which the module system doesn't support.

If it instead is a path, there won't be a conflict, the option
will only be defined once.
This commit is contained in:
tilpner 2018-07-21 18:07:26 +02:00
parent c0af3f63f5
commit 84adcfe5a8
No known key found for this signature in database
GPG key ID: 6A13327225BE51F6

View file

@ -295,11 +295,12 @@ NixOS modules should be placed in the `modules` attribute:
```nix
# modules/default.nix
{
example-module = import ./example-module.nix;
example-module = ./example-module.nix;
}
```
An example can be found [here](https://github.com/Mic92/nur-packages/tree/master/modules).
Modules should be defined as paths, not functions, to avoid conflicts if imported from multiple locations.
#### Providing Overlays