about summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2022-01-24 15:58:17 +0100
committerRobert Hensing <robert@roberthensing.nl>2022-03-03 00:28:35 +0100
commitd030e2109fd491e32cb48df54d100aa608551298 (patch)
tree6da4c8737d4d14e9cb049c5872f6671bbfe4494e /lib/types.nix
parent33e8df0921c410320185c9a1859656a4ec771f62 (diff)
downloadnixlib-d030e2109fd491e32cb48df54d100aa608551298.tar
nixlib-d030e2109fd491e32cb48df54d100aa608551298.tar.gz
nixlib-d030e2109fd491e32cb48df54d100aa608551298.tar.bz2
nixlib-d030e2109fd491e32cb48df54d100aa608551298.tar.lz
nixlib-d030e2109fd491e32cb48df54d100aa608551298.tar.xz
nixlib-d030e2109fd491e32cb48df54d100aa608551298.tar.zst
nixlib-d030e2109fd491e32cb48df54d100aa608551298.zip
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
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 3fcac9c31b31..51046c2c31b6 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -642,6 +642,11 @@ rec {
               else throw "A submoduleWith option is declared multiple times with conflicting shorthandOnlyDefinesConfig values";
           };
         };
+      } // {
+        # Submodule-typed options get special treatment in order to facilitate
+        # certain migrations, such as the addition of freeformTypes onto
+        # existing option trees.
+        isSubmodule = true;
       };
 
     # A value from a set of allowed ones.