Revert "Add option type for a submodule with extra arguments"

Moving recent types work to a separate branch for now

This reverts commit 8764758044.
This commit is contained in:
Shea Levy 2014-02-13 12:08:05 -05:00
parent 220654e205
commit 4fd825cc94

View File

@ -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;