Skip to content

Commit

Permalink
lib/types: Allow fullSubmodule to hide sub options
Browse files Browse the repository at this point in the history
This is needed for allowing the container.* option to be rewritten with
fullSubmodule such that not all NixOS options are doubly exposed in the
options listing
  • Loading branch information
infinisil committed Dec 15, 2019
1 parent 4ac09ea commit 571c7da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ rec {
{ configDefault ? false
, modules ? []
, specialArgs ? {}
, hideSubOptions ? false
}@attrs:
let
inherit (lib.modules) evalModules;
Expand All @@ -390,7 +391,7 @@ rec {
args.name = last loc;
prefix = loc;
}).config;
getSubOptions = prefix: (evalModules
getSubOptions = prefix: optionalAttrs (!hideSubOptions) (evalModules
{ inherit modules prefix specialArgs;
# This is a work-around due to the fact that some sub-modules,
# such as the one included in an attribute set, expects a "args"
Expand Down

0 comments on commit 571c7da

Please sign in to comment.