lib/modules: Add syntactic sugar for config._module.freeformType

This introduces `freeformType` as a top-level module attribute, allowing
definitions like

  {
    freeformType = ...;
    options = ...;
    config = ...;
  }
This commit is contained in:
Silvan Mosberger
2020-08-14 22:49:04 +02:00
parent e0ded8f4ba
commit 42cf8130d7
3 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
{ lib, ... }: {
config._module.freeformType = with lib.types; attrsOf (either str (attrsOf str));
freeformType = with lib.types; attrsOf (either str (attrsOf str));
}
+1 -1
View File
@@ -1,3 +1,3 @@
{ lib, ... }: {
config._module.freeformType = with lib.types; lazyAttrsOf (either str (lazyAttrsOf str));
freeformType = with lib.types; lazyAttrsOf (either str (lazyAttrsOf str));
}