From 3b7aca47e0d2523da3158a6522e768a461b08e9f Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Fri, 4 Sep 2020 13:53:03 +0200 Subject: [PATCH] lib/types: Set deprecationMessage for types.loaOf --- lib/types.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index 005be5123e7e..a8f744685f9b 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 {