mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-08 16:24:32 +02:00
ci/version-info: create temp files in a temp directory
Avoid polluting the repo with temporary `channels.{nix,json,toml}`
files. Write them to a temporary working directory instead.
(cherry picked from commit bc997a2409
)
This commit is contained in:
parent
f8b5a2fa7d
commit
76d059bac2
1 changed files with 19 additions and 12 deletions
|
@ -20,24 +20,31 @@ writeShellApplication {
|
|||
};
|
||||
|
||||
text = ''
|
||||
# Download channel info from NixOS/infra
|
||||
curl ${channelsURL} | nix eval --file - --json > channels.json
|
||||
|
||||
# Use channels.nix to build channels.toml
|
||||
nix build --impure \
|
||||
--file ${./supported-versions.nix} \
|
||||
--argstr system ${stdenv.hostPlatform.system} \
|
||||
--arg-from-file channelsJSON channels.json \
|
||||
--out-link channels.toml
|
||||
|
||||
work=$(mktemp -d)
|
||||
(
|
||||
cd "$work"
|
||||
|
||||
# Download channel info from NixOS/infra
|
||||
curl ${channelsURL} | nix eval --file - --json > channels.json
|
||||
|
||||
# Use channels.nix to build channels.toml
|
||||
nix build --impure \
|
||||
--file ${./supported-versions.nix} \
|
||||
--argstr system ${stdenv.hostPlatform.system} \
|
||||
--arg-from-file channelsJSON channels.json \
|
||||
--out-link channels.toml
|
||||
)
|
||||
|
||||
{
|
||||
echo "# DO NOT MODIFY!"
|
||||
echo "# This file was generated by ${
|
||||
lib.strings.removePrefix (toString ../.. + "/") (toString ./default.nix)
|
||||
}"
|
||||
cat ${mainInfo}
|
||||
echo
|
||||
cat channels.toml
|
||||
) > version-info.toml
|
||||
cat "$work/channels.toml"
|
||||
} > version-info.toml
|
||||
|
||||
rm -rf "$work"
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue