pkgs.formats.ini: share ignoredArgs between ini generators

This commit is contained in:
Eman Resu
2026-06-07 08:10:02 -04:00
parent ca14f513f3
commit cc2394d9fa
+10 -15
View File
@@ -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;
}
);
};