about summary refs log tree commit diff
path: root/lib/tests/modules
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-04-24 00:07:59 +0200
committerRobert Hensing <robert@roberthensing.nl>2022-04-24 00:07:59 +0200
commit224426ba6d4370ede958c127d9b9866a189522f9 (patch)
tree6c7acf114ed5e73c23ff114c41f60a5395942476 /lib/tests/modules
parent3ca4a1714a8990158dd69ca557248b121cbdc973 (diff)
lib.types.submoduleWith: Avoid _key collisions after extendModules
Diffstat (limited to 'lib/tests/modules')
-rw-r--r--lib/tests/modules/extendModules-168767-imports.nix41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/tests/modules/extendModules-168767-imports.nix b/lib/tests/modules/extendModules-168767-imports.nix
new file mode 100644
index 0000000000000..489e6b5a5d836
--- /dev/null
+++ b/lib/tests/modules/extendModules-168767-imports.nix
@@ -0,0 +1,41 @@
+{ lib
+, extendModules
+, ...
+}:
+with lib;
+{
+  imports = [
+
+    {
+      options.sub = mkOption {
+        default = { };
+        type = types.submodule (
+          { config
+          , extendModules
+          , ...
+          }:
+          {
+            options.value = mkOption {
+              type = types.int;
+            };
+
+            options.specialisation = mkOption {
+              default = { };
+              inherit
+                (extendModules {
+                  modules = [{
+                    specialisation = mkOverride 0 { };
+                  }];
+                })
+                type;
+            };
+          }
+        );
+      };
+    }
+
+    { config.sub.value = 1; }
+
+
+  ];
+}