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
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"
26 --maintainer maralorn \
27 "https://code.maralorn.de/maralorn/nix-output-monitor/archive/${new_version}.tar.gz" \