summaryrefslogtreecommitdiffstats
path: root/lib/types.nix
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-02-13 12:08:05 -0500
committerShea Levy <shea@shealevy.com>2014-02-13 12:10:50 -0500
commit4fd825cc94cf58d95007cd513ac5cb8e0c8409af (patch)
treea63c4eb2d8d3819c2952231c7e7aff94066e6862 /lib/types.nix
parent220654e2052774ec7d3d834547119db105686715 (diff)
Revert "Add option type for a submodule with extra arguments"
Moving recent types work to a separate branch for now This reverts commit 8764758044b0425de54228d87cc68a4ed6d4d414.
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 77957a7763ba..ac84ef296110 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -176,7 +176,7 @@ rec {
getSubOptions = elemType.getSubOptions;
};
- submoduleWithExtraArgs = extraArgs: opts:
+ submodule = opts:
let
opts' = toList opts;
inherit (import ./modules.nix) evalModules;
@@ -188,16 +188,13 @@ rec {
let
coerce = def: if isFunction def then def else { config = def; };
modules = opts' ++ map (def: { _file = def.file; imports = [(coerce def.value)]; }) defs;
- args = extraArgs // { name = last loc; };
- in (evalModules { inherit modules args; prefix = loc; }).config;
+ in (evalModules { inherit modules; args.name = last loc; prefix = loc; }).config;
getSubOptions = prefix: (evalModules
{ modules = opts'; inherit prefix;
# FIXME: hack to get shit to evaluate.
- args = extraArgs // { name = ""; }; }).options;
+ args = { name = ""; }; }).options;
};
- submodule = submoduleWithExtraArgs {};
-
nixosSubmodule = nixos: args: mkOptionType rec {
name = "submodule containing a NixOS config";
check = x: isAttrs x || isFunction x;