forked from mirrors/nixpkgs
Revert "Add nixosSubmodule option type"
Moving recent types work to a separate branch for now
This reverts commit 2bf0067dad
.
This commit is contained in:
parent
83f6beb219
commit
66a52fe37c
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue