about summary refs log tree commit diff
path: root/lib/types.nix
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-09-04 13:53:03 +0200
committerSilvan Mosberger <contact@infinisil.com>2020-09-07 13:17:19 +0200
commit3b7aca47e0d2523da3158a6522e768a461b08e9f (patch)
tree7195f417511e2c02643e0ea63c9a4645a3844cf0 /lib/types.nix
parent2bed3b2ad7e671f75580c0df7d2b644bde0181b7 (diff)
lib/types: Set deprecationMessage for types.loaOf
Diffstat (limited to 'lib/types.nix')
-rw-r--r--lib/types.nix14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/types.nix b/lib/types.nix
index 005be5123e7e4..a8f744685f9bf 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -329,14 +329,12 @@ rec {
     };
 
     # TODO: drop this in the future:
-    loaOf =
-      let msg =
-        ''
-          `types.loaOf` has been removed and mixing lists with attribute values
-          is no longer possible; please use `types.attrsOf` instead.
-          See https://github.com/NixOS/nixpkgs/issues/1800 for the motivation.
-        '';
-      in builtins.trace msg types.attrsOf;
+    loaOf = elemType: types.attrsOf elemType // {
+      name = "loaOf";
+      deprecationMessage = "Mixing lists with attribute values is no longer"
+        + " possible; please use `types.attrsOf` instead. See"
+        + " https://github.com/NixOS/nixpkgs/issues/1800 for the motivation.";
+    };
 
     # Value of given type but with no merging (i.e. `uniq list`s are not concatenated).
     uniq = elemType: mkOptionType rec {