about summary refs log tree commit diff
path: root/nixpkgs/lib/tests/modules/submoduleFiles.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/lib/tests/modules/submoduleFiles.nix')
-rw-r--r--nixpkgs/lib/tests/modules/submoduleFiles.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/nixpkgs/lib/tests/modules/submoduleFiles.nix b/nixpkgs/lib/tests/modules/submoduleFiles.nix
new file mode 100644
index 000000000000..c0d9b2cef3e8
--- /dev/null
+++ b/nixpkgs/lib/tests/modules/submoduleFiles.nix
@@ -0,0 +1,21 @@
+{ lib, ... }: {
+  options.submodule = lib.mkOption {
+    default = {};
+    type = lib.types.submoduleWith {
+      modules = [ ({ options, ... }: {
+        options.value = lib.mkOption {};
+
+        options.internalFiles = lib.mkOption {
+          default = options.value.files;
+        };
+      })];
+    };
+  };
+
+  imports = [
+    {
+      _file = "the-file.nix";
+      submodule.value = 10;
+    }
+  ];
+}