Commit 040b0ad3 authored by Silvan Mosberger's avatar Silvan Mosberger
Browse files

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

This reverts commit c59c6b1c.

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
4b54aede, but had to be reverted in
a36e6760 because it caused infinite
recursion for some users, and I couldn't remember that it was reverted.
parent ec886625
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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}";