Add NUR export validation script
This commit is contained in:
parent
5e48ab41b2
commit
f050831191
1 changed files with 23 additions and 0 deletions
23
tasks/validate-nur
Executable file
23
tasks/validate-nur
Executable file
|
@ -0,0 +1,23 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
for channel in 'unstable' 'nixpkgs'; do
|
||||||
|
nix_args=(
|
||||||
|
--option restrict-eval 'true'
|
||||||
|
-I './'
|
||||||
|
-I "$channel=$(realpath "$(nix-instantiate --find-file "$channel")")"
|
||||||
|
--arg 'pkgs' "import <$channel> { overlays = [ ]; }"
|
||||||
|
)
|
||||||
|
|
||||||
|
nix-env "${nix_args[@]}" --file 'nur.nix' --query '*' --available --meta --json \
|
||||||
|
| jq --raw-output 'to_entries[] | "\(.key)\(.value.meta.broken)"' \
|
||||||
|
| while IFS='' read -r name broken; do
|
||||||
|
if [[ $broken == 'true' ]]; then
|
||||||
|
echo "⚠️ Build marked as broken for $name@$channel"
|
||||||
|
elif nix-build "${nix_args[@]}" 'nur.nix' --attr "$name" --no-out-link; then
|
||||||
|
echo "✅ Build succeeded for $name@$channel"
|
||||||
|
else
|
||||||
|
echo "❌️ Build failed for $name@$channel"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
Loading…
Reference in a new issue