aboutsummaryrefslogtreecommitdiff
path: root/tests/modules/freeform-submodules.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2023-08-16 15:46:37 +0200
committerRobert Hensing <robert@roberthensing.nl>2023-08-16 15:46:37 +0200
commit63e0b5d081fed582ac6a0a66f402dc525953524b (patch)
tree1bdcd7fc8a6a40b2e805bad759b36e64e911036b /tests/modules/freeform-submodules.nix
GC root for fetched nixpkgs/lib content
Diffstat (limited to 'tests/modules/freeform-submodules.nix')
-rw-r--r--tests/modules/freeform-submodules.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/modules/freeform-submodules.nix b/tests/modules/freeform-submodules.nix
new file mode 100644
index 000000000..3910435a7
--- /dev/null
+++ b/tests/modules/freeform-submodules.nix
@@ -0,0 +1,22 @@
+{ lib, options, ... }: with lib.types; {
+
+ options.fooDeclarations = lib.mkOption {
+ default = (options.free.type.getSubOptions [])._freeformOptions.foo.declarations;
+ };
+
+ options.free = lib.mkOption {
+ type = submodule {
+ config._module.freeformType = lib.mkMerge [
+ (attrsOf (submodule {
+ options.foo = lib.mkOption {};
+ }))
+ (attrsOf (submodule {
+ options.bar = lib.mkOption {};
+ }))
+ ];
+ };
+ };
+
+ config.free.xxx.foo = 10;
+ config.free.yyy.bar = 10;
+}