From 84adcfe5a80d643dbe106a8b18c0c199e24e49c1 Mon Sep 17 00:00:00 2001 From: tilpner Date: Sat, 21 Jul 2018 18:07:26 +0200 Subject: [PATCH] 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. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0ff16e076..789a18034 100644 --- a/README.md +++ b/README.md @@ -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