mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-23 00:50:59 +00:00
formats.javaProperties: use structuredAttrs instead of passAsFile
Tested via `nix-build -A tests.pkgs-lib.java-properties`
This commit is contained in:
@@ -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"
|
||||
''
|
||||
|
||||
Reference in New Issue
Block a user