From 35bf5793a694691237704fe430bd1d169cedc72d Mon Sep 17 00:00:00 2001 From: catvayor Date: Wed, 23 Apr 2025 15:33:34 +0200 Subject: [PATCH] fix(modules/extranix): don't crash when having to many options --- modules/nixos/extranix/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/nixos/extranix/default.nix b/modules/nixos/extranix/default.nix index 9edbe23..ce3fe55 100644 --- a/modules/nixos/extranix/default.nix +++ b/modules/nixos/extranix/default.nix @@ -164,9 +164,14 @@ let } '' mkdir -p $out - jq -r '.options[].descriptionHTML | "--rawfile\n" + . + "\n" + .' $resultPath | xargs \ - jq -c '.options |= map(.descriptionHTML as $desc | .descriptionHTML |= $ARGS.named.[$desc])' $resultPath \ - > $out/$fileName + cp $resultPath new + for key in $(jq -r '.options | keys.[]' $resultPath); do + mv new curr + jq -r ".options[$key].descriptionHTML" $resultPath | xargs \ + jq -c ".options[$key].descriptionHTML |= \$ARGS.named.desc" curr --rawfile desc \ + > new + done + cp new $out/$fileName ''; website =