mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
lib.modules: Let module declare options directly in bare submodule
... 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 #146882
This commit is contained in:
parent
33e8df0921
commit
d030e2109f
7 changed files with 75 additions and 1 deletions
12
lib/tests/modules/declare-bare-submodule.nix
Normal file
12
lib/tests/modules/declare-bare-submodule.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
in
|
||||
{
|
||||
options.bare-submodule = mkOption {
|
||||
type = types.submoduleWith {
|
||||
modules = [ ];
|
||||
};
|
||||
default = {};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue