summary refs log tree commit diff
path: root/nixos/modules/misc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-03-01 20:47:08 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-03-01 20:52:06 +0100
commitf3d94cfc23a2787772a369e2ca9e0cd94e72b8b3 (patch)
tree2501bf5c09108c836925aefc4674ebec0b508193 /nixos/modules/misc
parentbf4cafd1ddbd7c396a9df6a5d0fb02f2b7d21896 (diff)
downloadnixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.tar
nixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.tar.gz
nixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.tar.bz2
nixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.tar.lz
nixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.tar.xz
nixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.tar.zst
nixlib-f3d94cfc23a2787772a369e2ca9e0cd94e72b8b3.zip
Revert "Add the tool "nixos-typecheck" that can check an option declaration to:"
This reverts commit cad8957eabcbf73062226d28366fd446c15c8737. It
breaks NixOps, but more importantly, such major changes to the module
system really need to be reviewed.
Diffstat (limited to 'nixos/modules/misc')
-rw-r--r--nixos/modules/misc/meta.nix1
-rw-r--r--nixos/modules/misc/nixpkgs.nix49
2 files changed, 23 insertions, 27 deletions
diff --git a/nixos/modules/misc/meta.nix b/nixos/modules/misc/meta.nix
index 9a453172c63a..22622706f2c8 100644
--- a/nixos/modules/misc/meta.nix
+++ b/nixos/modules/misc/meta.nix
@@ -5,7 +5,6 @@ with lib;
 let
   maintainer = mkOptionType {
     name = "maintainer";
-    typerep = "(maintainer)";
     check = email: elem email (attrValues lib.maintainers);
     merge = loc: defs: listToAttrs (singleton (nameValuePair (last defs).file (last defs).value));
   };
diff --git a/nixos/modules/misc/nixpkgs.nix b/nixos/modules/misc/nixpkgs.nix
index 511831ae5cd2..5eb38c510b48 100644
--- a/nixos/modules/misc/nixpkgs.nix
+++ b/nixos/modules/misc/nixpkgs.nix
@@ -3,35 +3,32 @@
 with lib;
 
 let
-  nixpkgsConfig = pkgs:
-    let
-      isConfig = x:
-        builtins.isAttrs x || builtins.isFunction x;
+  isConfig = x:
+    builtins.isAttrs x || builtins.isFunction x;
 
-      optCall = f: x:
-        if builtins.isFunction f
-        then f x
-        else f;
+  optCall = f: x:
+    if builtins.isFunction f
+    then f x
+    else f;
 
-      mergeConfig = lhs_: rhs_:
-        let
-          lhs = optCall lhs_ { inherit pkgs; };
-          rhs = optCall rhs_ { inherit pkgs; };
-        in
-        lhs // rhs //
-        optionalAttrs (lhs ? packageOverrides) {
-          packageOverrides = pkgs:
-            optCall lhs.packageOverrides pkgs //
-            optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
-        };
+  mergeConfig = lhs_: rhs_:
+    let
+      lhs = optCall lhs_ { inherit pkgs; };
+      rhs = optCall rhs_ { inherit pkgs; };
     in
-    mkOptionType {
-      name = "nixpkgs config";
-      typerep = "(nixpkgsConfig)";
-      check = lib.traceValIfNot isConfig;
-      merge = config: args: fold (def: mergeConfig def.value) {};
-      defaultValues = [{}];
+    lhs // rhs //
+    optionalAttrs (lhs ? packageOverrides) {
+      packageOverrides = pkgs:
+        optCall lhs.packageOverrides pkgs //
+        optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
     };
+
+  configType = mkOptionType {
+    name = "nixpkgs config";
+    check = traceValIfNot isConfig;
+    merge = args: fold (def: mergeConfig def.value) {};
+  };
+
 in
 
 {
@@ -49,7 +46,7 @@ in
             };
           }
         '';
-      type = nixpkgsConfig pkgs;
+      type = configType;
       description = ''
         The configuration of the Nix Packages collection.  (For
         details, see the Nixpkgs documentation.)  It allows you to set