summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 17:40:36 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 22:45:57 +0100
commit136707494062c86d1c7269f9ea363fc267e95b78 (patch)
treeaff7e405807d15d419fa925fe8ddaaaf880f3135 /lib/modules.nix
parent1e24ce2a9b8cb5976d81ba9ff83f95440703de1a (diff)
downloadnixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.tar
nixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.tar.gz
nixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.tar.bz2
nixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.tar.lz
nixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.tar.xz
nixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.tar.zst
nixpkgs-136707494062c86d1c7269f9ea363fc267e95b78.zip
Allow imports in plain modules
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 184b21de486..f6b866304d0 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -36,7 +36,7 @@ rec {
   /* Massage a module into canonical form, that is, a set consisting
      of ‘options’, ‘config’ and ‘imports’ attributes. */
   unifyModuleSyntax = file: key: m:
-    if m ? config || m ? options || m ? imports then
+    if m ? config || m ? options then
       let badAttrs = removeAttrs m ["imports" "options" "config" "key"]; in
       if badAttrs != {} then
         throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'."
@@ -50,9 +50,9 @@ rec {
     else
       { inherit file;
         key = m.key or key;
-        imports = m.require or [];
+        imports = m.require or [] ++ m.imports or [];
         options = {};
-        config = removeAttrs m ["key" "require"];
+        config = removeAttrs m ["key" "require" "imports"];
       };
 
   applyIfFunction = f: arg: if builtins.isFunction f then f arg else f;