ci: rename update-scriptsci

This changes how we think about this directory; it does not need to be
exclusively for scripts related to updates, but should be a place for
any scripts intended to be run by CI workflows.

This mindset should make it easier to develop and test the business
logic of workflows, without always needing to test "in production" on
the nixvim repo or a fork.
This commit is contained in:
Matt Sturgeon 2025-06-11 22:13:00 +01:00
parent 7388c85c54
commit 2b2b1e6d8f
18 changed files with 13 additions and 12 deletions

View file

@ -0,0 +1,42 @@
{
lib,
callPackage,
writeShellApplication,
stdenv,
}:
let
mainInfo = callPackage ./main.nix { };
channelsURL = "https://raw.githubusercontent.com/NixOS/infra/refs/heads/main/channels.nix";
in
writeShellApplication {
name = "version-info";
runtimeEnv = {
NIX_CONFIG = ''
experimental-features = nix-command flakes pipe-operators
'';
};
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 \
--inputs-from ${toString ../..} \
--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
'';
}