mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-07 15:54:31 +02:00
update-scripts/version-info: get channel status for supported versions
Fetch channel info from NixOS/infra, the canonical source of truth.
(cherry picked from commit 9328f4437d
)
This commit is contained in:
parent
dfbab369c4
commit
8917e2e8ec
3 changed files with 99 additions and 0 deletions
|
@ -2,19 +2,41 @@
|
|||
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
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue