summaryrefslogtreecommitdiffstats
path: root/lib/types.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 15:33:20 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-30 15:35:09 +0100
commit70a2c545274cda238c5eda28b60cfa9dbc6f7ed6 (patch)
treed3629d90b938f5be866f2977c26976198f4ab014 /lib/types.nix
parentdb2a9afb75abc50497fcde61470c2b83795e4669 (diff)
Strictly check the arguments to mkOption
And fix various instances of bad arguments.
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index cf8eef008337..2b3aa23df2f1 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -201,6 +201,9 @@ rec {
name = /* builtins.trace "types.optionSet is deprecated; use types.submodule instead" */ "option set";
};
+ # Augment the given type with an additional type check function.
+ addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; };
+
};
}