Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
28 lines
838 B
Bash
Executable File
28 lines
838 B
Bash
Executable File
#!/usr/bin/env nix-shell
|
|
#!nix-shell -i bash -p cabal2nix curl jq
|
|
#
|
|
# This script will update the nixfmt derivation to the latest version using
|
|
# cabal2nix.
|
|
|
|
set -eo pipefail
|
|
|
|
# This is the directory of this update.sh script.
|
|
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
derivation_file="${script_dir}/generated-package.nix"
|
|
|
|
release_tag=$(curl --silent https://api.github.com/repos/NixOS/nixfmt/releases/latest | jq '.tag_name' --raw-output)
|
|
|
|
echo "Updating nixfmt to version $release_tag."
|
|
echo "Running cabal2nix and outputting to ${derivation_file}..."
|
|
|
|
cat > "$derivation_file" << EOF
|
|
# This file has been autogenerate with cabal2nix.
|
|
# Update via ./update.sh
|
|
EOF
|
|
|
|
cabal2nix --jailbreak \
|
|
"https://github.com/nixos/nixfmt/archive/${release_tag}.tar.gz" \
|
|
>> "$derivation_file"
|
|
|
|
echo "Finished."
|