27 lines
734 B
Bash
Executable File
27 lines
734 B
Bash
Executable File
#!/bin/bash
|
|
# Met à jour le commit de référence pour Nixpkgs
|
|
|
|
BRANCH="nixos-25.11"
|
|
REPO="https://github.com/NixOS/nixpkgs"
|
|
JSON_FILE="$(dirname "$0")/../pkgs/nixpkgs.json"
|
|
|
|
echo "Récupération du dernier commit sur $BRANCH..."
|
|
REV=$(git ls-remote $REPO refs/heads/$BRANCH | cut -f1)
|
|
|
|
if [ -z "$REV" ]; then
|
|
echo "Erreur : Impossible de récupérer le commit."
|
|
exit 1
|
|
fi
|
|
|
|
echo "Calcul du hash (cela peut prendre un moment)..."
|
|
SHA256=$(nix-prefetch-url --unpack "https://github.com/NixOS/nixpkgs/archive/$REV.tar.gz")
|
|
|
|
cat <<EOF > "$JSON_FILE"
|
|
{
|
|
"url": "https://github.com/NixOS/nixpkgs/archive/$REV.tar.gz",
|
|
"rev": "$REV",
|
|
"sha256": "$SHA256"
|
|
}
|
|
EOF
|
|
|
|
echo "Succès ! Nixpkgs est maintenant épinglé au commit : $REV" |