diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 2f3e5ad9d191..3d0f800873d2 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -256,6 +256,11 @@ optionalAttrs allowAliases aliases mapAttrs (key: val: if isList val then listToValue val else val) else id; + + ignoredArgs = [ + "listToValue" + "atomsCoercedToLists" + ]; in { ini = @@ -287,12 +292,7 @@ optionalAttrs allowAliases aliases name: value: pipe value [ (mapAttrs (_: maybeToList listToValue)) - (toINI ( - removeAttrs args [ - "listToValue" - "atomsCoercedToLists" - ] - )) + (toINI (removeAttrs args ignoredArgs)) (pkgs.writeText name) ]; }; @@ -341,15 +341,10 @@ optionalAttrs allowAliases aliases ... }: pkgs.writeText name ( - toINIWithGlobalSection - (removeAttrs args [ - "listToValue" - "atomsCoercedToLists" - ]) - { - globalSection = maybeToList listToValue globalSection; - sections = mapAttrs (_: maybeToList listToValue) sections; - } + toINIWithGlobalSection (removeAttrs args ignoredArgs) { + globalSection = maybeToList listToValue globalSection; + sections = mapAttrs (_: maybeToList listToValue) sections; + } ); };