From 3198ae073a62c8e7565e62d0117a8926e88fc9ef Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Sun, 7 Jun 2026 08:11:43 -0400 Subject: [PATCH] pkgs.formats.ini: rename list coercion helper It coerces lists, it doesn't turn other attributes into lists. --- pkgs/pkgs-lib/formats.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 3d0f800873d2..72586dca934d 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -250,7 +250,7 @@ optionalAttrs allowAliases aliases description = "section of an INI file (attrs of " + atom.description + ")"; }; - maybeToList = + maybeCoerceList = listToValue: if listToValue != null then mapAttrs (key: val: if isList val then listToValue val else val) @@ -291,7 +291,7 @@ optionalAttrs allowAliases aliases generate = name: value: pipe value [ - (mapAttrs (_: maybeToList listToValue)) + (mapAttrs (_: maybeCoerceList listToValue)) (toINI (removeAttrs args ignoredArgs)) (pkgs.writeText name) ]; @@ -342,8 +342,8 @@ optionalAttrs allowAliases aliases }: pkgs.writeText name ( toINIWithGlobalSection (removeAttrs args ignoredArgs) { - globalSection = maybeToList listToValue globalSection; - sections = mapAttrs (_: maybeToList listToValue) sections; + globalSection = maybeCoerceList listToValue globalSection; + sections = mapAttrs (_: maybeCoerceList listToValue) sections; } ); };