formats.javaProperties: use structuredAttrs instead of passAsFile

Tested via `nix-build -A tests.pkgs-lib.java-properties`
This commit is contained in:
Stefan Frijters
2026-06-10 15:18:50 +02:00
parent 0634e1e5c1
commit dfde99fd70

View File

@@ -106,13 +106,14 @@ in
# general.
preferLocalBuild = true;
passAsFile = [ "value" ];
value = builtins.toJSON value;
nativeBuildInputs = [
jq
libiconvReal
];
__structuredAttrs = true;
jqCode =
let
main = ''
@@ -151,7 +152,7 @@ in
(
echo "$comment" | while read -r ln; do echo "# $ln"; done
echo
jq -r --arg hash '#' "$jqCode" "$valuePath" \
printf "%s" "$value" | jq -r --arg hash '#' "$jqCode" \
| iconv --from-code "$inputEncoding" --to-code JAVA \
) > "$out"
''