formats: extract things needed from pkgs in the let binding

This is an attempt to solve the NixOS manual failures seen in https://github.com/NixOS/nixpkgs/pull/415662
This commit is contained in:
Philip Taron
2025-06-10 16:29:36 -07:00
parent f13654fe8a
commit a822df313f
+20 -20
View File
@@ -52,26 +52,26 @@ let
# Attributes added accidentally in https://github.com/NixOS/nixpkgs/pull/335232 (2024-08-18)
# Deprecated in https://github.com/NixOS/nixpkgs/pull/415666 (2025-06)
aliases =
lib.mapAttrs (name: lib.warn "`formats.${name}` is deprecated; use `lib.types.${name}` instead.")
{
inherit
attrsOf
bool
coercedTo
either
float
int
listOf
luaInline
mkOptionType
nonEmptyListOf
nullOr
oneOf
path
str
;
};
allowAliases = pkgs.config.allowAliases or false;
aliasWarning = name: warn "`formats.${name}` is deprecated; use `lib.types.${name}` instead.";
aliases = mapAttrs aliasWarning {
inherit
attrsOf
bool
coercedTo
either
float
int
listOf
luaInline
mkOptionType
nonEmptyListOf
nullOr
oneOf
path
str
;
};
in
optionalAttrs allowAliases aliases
// rec {