3
0
Fork 0
forked from mirrors/nixpkgs

Revert "Add nixosSubmodule option type"

Moving recent types work to a separate branch for now

This reverts commit ca1c5cfa8f.
This commit is contained in:
Shea Levy 2014-02-13 12:08:15 -05:00
parent 4fd825cc94
commit c8f1a6ac1e
2 changed files with 1 additions and 21 deletions

View file

@ -195,25 +195,6 @@ rec {
args = { name = ""; }; }).options;
};
nixosSubmodule = nixos: args: mkOptionType rec {
name = "submodule containing a NixOS config";
check = x: isAttrs x || isFunction x;
merge = loc: defs:
let
coerce = def: if isFunction def then def else { config = def; };
in (import (nixos + "/lib/eval-config.nix") (args // {
modules = (args.modules or []) ++
map (def: { _file = def.file; imports = [(coerce def.value)]; }) defs;
prefix = loc;
})).config;
getSubOptions = prefix: (import (nixos + "/lib/eval-config.nix") (args // {
modules = (args.modules or []);
inherit prefix;
})).options;
};
# Obsolete alternative to configOf. It takes its option
# declarations from the options attribute of containing option
# declaration.

View file

@ -15,7 +15,6 @@ with pkgs.lib;
};
systemd.containers = mkOption {
# !!! Should probably use nixosSubmodule here
type = types.attrsOf (types.submodule (
{ config, options, name, ... }:
{
@ -135,4 +134,4 @@ with pkgs.lib;
}) config.systemd.containers;
};
}
}