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 #!/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 set -euo pipefail
cd "$(dirname "$0")" 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 nix run --flake-registry "$PWD/flake-registry.json" nixpkgs#hello

View file

@ -34,6 +34,17 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "bundlers",
"type": "indirect"
},
"to": {
"owner": "NixOS",
"repo": "bundlers",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "cachix", "id": "cachix",
@ -146,12 +157,12 @@
}, },
{ {
"from": { "from": {
"id": "hercules-ci-effects", "id": "helix",
"type": "indirect" "type": "indirect"
}, },
"to": { "to": {
"owner": "hercules-ci", "owner": "helix-editor",
"repo": "hercules-ci-effects", "repo": "helix",
"type": "github" "type": "github"
} }
}, },
@ -166,6 +177,17 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "hercules-ci-effects",
"type": "indirect"
},
"to": {
"owner": "hercules-ci",
"repo": "hercules-ci-effects",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "home-manager", "id": "home-manager",
@ -199,6 +221,17 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "nickel",
"type": "indirect"
},
"to": {
"owner": "tweag",
"repo": "nickel",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "nimble", "id": "nimble",
@ -232,6 +265,17 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "nix-serve",
"type": "indirect"
},
"to": {
"owner": "edolstra",
"repo": "nix-serve",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "nixops", "id": "nixops",
@ -276,17 +320,6 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "nur",
"type": "indirect"
},
"to": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "nixpkgs", "id": "nixpkgs",
@ -301,12 +334,12 @@
}, },
{ {
"from": { "from": {
"id": "templates", "id": "nur",
"type": "indirect" "type": "indirect"
}, },
"to": { "to": {
"owner": "NixOS", "owner": "nix-community",
"repo": "templates", "repo": "NUR",
"type": "github" "type": "github"
} }
}, },
@ -332,39 +365,6 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "nix-serve",
"type": "indirect"
},
"to": {
"owner": "edolstra",
"repo": "nix-serve",
"type": "github"
}
},
{
"from": {
"id": "nickel",
"type": "indirect"
},
"to": {
"owner": "tweag",
"repo": "nickel",
"type": "github"
}
},
{
"from": {
"id": "bundlers",
"type": "indirect"
},
"to": {
"owner": "NixOS",
"repo": "bundlers",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "pridefetch", "id": "pridefetch",
@ -376,6 +376,17 @@
"type": "github" "type": "github"
} }
}, },
{
"from": {
"id": "sops-nix",
"type": "indirect"
},
"to": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
{ {
"from": { "from": {
"id": "systems", "id": "systems",
@ -389,23 +400,12 @@
}, },
{ {
"from": { "from": {
"id": "helix", "id": "templates",
"type": "indirect" "type": "indirect"
}, },
"to": { "to": {
"owner": "helix-editor", "owner": "NixOS",
"repo": "helix", "repo": "templates",
"type": "github"
}
},
{
"from": {
"id": "sops-nix",
"type": "indirect"
},
"to": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github" "type": "github"
} }
} }