mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
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:
parent
85431f78aa
commit
fa6c098e02
1 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue