diff options
author | Shea Levy <shea@shealevy.com> | 2014-02-13 12:08:05 -0500 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2014-02-13 12:10:50 -0500 |
commit | 4fd825cc94cf58d95007cd513ac5cb8e0c8409af (patch) | |
tree | a63c4eb2d8d3819c2952231c7e7aff94066e6862 /lib/types.nix | |
parent | 220654e2052774ec7d3d834547119db105686715 (diff) | |
download | nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.tar nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.tar.gz nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.tar.bz2 nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.tar.lz nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.tar.xz nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.tar.zst nixpkgs-4fd825cc94cf58d95007cd513ac5cb8e0c8409af.zip |
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.nix | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/types.nix b/lib/types.nix index 77957a7763b..ac84ef29611 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; |