From 9af74cc7096baa29e64edb2179604bcf494e55f3 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 29 Dec 2022 00:47:50 +0100 Subject: [PATCH 1/2] Revert "lib/types: remove loaOf" This reverts commit c8c538f2ab2432f2dd1eb637657c1bf5b54a147f. Reason: removal did not follow a deprecation process and it hurts nixops 1.7 users. --- lib/types.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/types.nix b/lib/types.nix index e7e8a99e5743..270ac1748c79 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -558,6 +558,15 @@ rec { nestedTypes.elemType = elemType; }; + # TODO: drop this in the future: + 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."; + nestedTypes.elemType = elemType; + }; + # Value of given type but with no merging (i.e. `uniq list`s are not concatenated). uniq = elemType: mkOptionType rec { name = "uniq"; From ef9b04ec5fe9bad204381e217ca150cec242e128 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 29 Dec 2022 00:49:32 +0100 Subject: [PATCH 2/2] lib.types.loaOf: Update comment to say deprecate instead of remove --- lib/types.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types.nix b/lib/types.nix index 270ac1748c79..e741bec6c29d 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -558,7 +558,7 @@ rec { nestedTypes.elemType = elemType; }; - # TODO: drop this in the future: + # TODO: deprecate this in the future: loaOf = elemType: types.attrsOf elemType // { name = "loaOf"; deprecationMessage = "Mixing lists with attribute values is no longer"