style: ensure flake registry remains sorted (#50)

Additionally, ensure the latest contents of `flake-registry.json` are
used when running `ci.sh`. Without `--tarball-ttl 0`, old contents can
be reused across multiple runs. This shouldn't be an issue in CI, but
it's helpful when running `ci.sh` manually, during development.
This commit is contained in:
bb010g 2024-01-15 00:53:46 -08:00 committed by GitHub
parent 3f641cbae1
commit 9c69f7bd23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 69 additions and 65 deletions

6
ci.sh
View file

@ -1,7 +1,11 @@
#!/usr/bin/env bash
# Test that the flake-registry.json format is valid
# Test that the flake-registry.json format is sorted & valid
set -euo pipefail
cd "$(dirname "$0")"
# Ensure current flake-registry.json file is sorted.
nix registry list --tarball-ttl 0 --flake-registry "$PWD/flake-registry.json" \
| grep -- '^global ' | LC_ALL=C sort -u -c
nix run --flake-registry "$PWD/flake-registry.json" nixpkgs#hello