Skip to content

Commit

Permalink
lib.modules: Default shorthandOnlyDefinesConfig to true when null
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Mar 2, 2022
1 parent 6b077c4 commit 28aeae2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,13 @@ rec {
let
inherit (lib.modules) evalModules;

shorthandToModule = if shorthandOnlyDefinesConfig == false
then value: value
else value: { config = value; };

coerce = unify: value: if isFunction value
then setFunctionArgs (args: unify (value args)) (functionArgs value)
else unify (if shorthandOnlyDefinesConfig then { config = value; } else value);
else unify (shorthandToModule value);

allModules = defs: imap1 (n: { value, file }:
if isAttrs value || isFunction value then
Expand Down

0 comments on commit 28aeae2

Please sign in to comment.