Revert "lib.types.string: Deprecation error instead of warning"

This reverts commit c59c6b1c57.

This was a bit too ambitious, because no warnings were previously
triggered when `string` was nested e.g. `attrsOf string`, `nullOr
string`, etc.

Support for nested type deprecation warnings was introduced in
4b54aedee5, but had to be reverted in
a36e6760e9 because it caused infinite
recursion for some users, and I couldn't remember that it was reverted.
This commit is contained in:
Silvan Mosberger 2023-08-10 06:25:29 +02:00
parent ec8866254a
commit 040b0ad3ed

View File

@ -436,7 +436,10 @@ rec {
# Deprecated; should not be used because it quietly concatenates
# strings, which is usually not what you want.
string = throw "The type `types.string` is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.";
string = separatedString "" // {
name = "string";
deprecationMessage = "See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.";
};
passwdEntry = entryType: addCheck entryType (str: !(hasInfix ":" str || hasInfix "\n" str)) // {
name = "passwdEntry ${entryType.name}";