jql: 8.0.0 -> 8.0.2 (#362884)
[NixPkgs.git] / pkgs / tools / nix / nix-output-monitor / update.sh
bloba83043df66ee605fe43b21482b4a38bcb9c62480
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p cabal2nix curl jq
4 # This script will update the nix-output-monitor derivation to the latest version using
5 # cabal2nix.
7 set -eo pipefail
9 # This is the directory of this update.sh script.
10 script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
12 derivation_file="${script_dir}/generated-package.nix"
14 # This is the latest released version of nix-output-monitor on GitHub.
15 new_version=$(curl --silent "https://code.maralorn.de/api/v1/repos/maralorn/nix-output-monitor/releases" | jq '.[0].tag_name' --raw-output)
17 echo "Updating nix-output-monitor to version $new_version."
18 echo "Running cabal2nix and outputting to ${derivation_file}..."
20 cat > "$derivation_file" << EOF
21 # This file has been autogenerate with cabal2nix.
22 # Update via ./update.sh"
23 EOF
25 cabal2nix \
26 --maintainer maralorn \
27 "https://code.maralorn.de/maralorn/nix-output-monitor/archive/${new_version}.tar.gz" \
28 >> "$derivation_file"
30 echo "Finished."