... where a bare submodule is an option that has a type like `submoduleWith x`, as opposed to `attrsOf (submoduleWith x)`. This makes migration unnecessary when introducing a freeform type in an existing option tree. Closes #146882main
parent
33e8df0921
commit
d030e2109f
@ -0,0 +1,10 @@ |
||||
{ lib, ... }: |
||||
let |
||||
inherit (lib) mkOption types; |
||||
in |
||||
{ |
||||
options.bare-submodule.deep = mkOption { |
||||
type = types.int; |
||||
default = 2; |
||||
}; |
||||
} |
@ -0,0 +1,18 @@ |
||||
{ lib, ... }: |
||||
let |
||||
inherit (lib) mkOption types; |
||||
in |
||||
{ |
||||
options.bare-submodule = mkOption { |
||||
type = types.submoduleWith { |
||||
modules = [ |
||||
{ |
||||
options.nested = mkOption { |
||||
type = types.int; |
||||
default = 1; |
||||
}; |
||||
} |
||||
]; |
||||
}; |
||||
}; |
||||
} |
@ -0,0 +1,12 @@ |
||||
{ lib, ... }: |
||||
let |
||||
inherit (lib) mkOption types; |
||||
in |
||||
{ |
||||
options.bare-submodule = mkOption { |
||||
type = types.submoduleWith { |
||||
modules = [ ]; |
||||
}; |
||||
default = {}; |
||||
}; |
||||
} |
@ -0,0 +1,4 @@ |
||||
{ |
||||
bare-submodule.nested = 42; |
||||
bare-submodule.deep = 420; |
||||
} |
Loading…
Reference in new issue