chore: improve nix-ci:build build time by using only builtins.toJSON

removes dependency on remarshal, pkgs.formats.json uses jq to pretty
print so we just use builtins.toJSON directly
This commit is contained in:
technofab 2025-02-27 10:52:47 +01:00
parent 85431f78aa
commit fa6c098e02

View file

@ -161,7 +161,15 @@
}; };
config.legacyPackages = let config.legacyPackages = let
toYaml = (pkgs.formats.yaml {}).generate; # NOTE: json is also valid yaml and this removes dependency on jq
# and/or remarshal (used in pkgs.formats.json and pkgs.formats.yaml
# respectively)
toYaml = name: value:
pkgs.runCommand name {} ''
cat <<EOT >> $out
${builtins.toJSON value}
EOT
'';
mapAttrs = cb: set: builtins.listToAttrs (builtins.map (key: cb key (builtins.getAttr key set)) (builtins.attrNames set)); mapAttrs = cb: set: builtins.listToAttrs (builtins.map (key: cb key (builtins.getAttr key set)) (builtins.attrNames set));
prepend = key: arr: job: prepend = key: arr: job:
job job