nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1#!/usr/bin/env nix-shell
2#!nix-shell -i nu -p nushell nixfmt common-updater-scripts
3
4let latest = ^list-git-tags --url=https://github.com/ghostty-org/ghostty
5 | lines
6 | sort --natural
7 | last
8 | str trim --left --char "v"
9
10let current = ^nix-instantiate --eval -A ghostty.version | str trim -c '"'
11
12if $latest == $current {
13 print "Up to date!"
14 exit
15}
16
17print $"Updating Ghostty: ($current) -> ($latest)"
18
19^update-source-version ghostty $latest --file=./pkgs/by-name/gh/ghostty/package.nix
20
21# Update deps.nix
22http get $"https://raw.githubusercontent.com/ghostty-org/ghostty/refs/tags/v($latest)/build.zig.zon.nix"
23 | ^nixfmt
24 | save -f ./pkgs/by-name/gh/ghostty/deps.nix
25
26# In extraordinary cases the DMG might take a while to be notarized by Apple
27# and so it's possible for a Git tag to have no corresponding notarized DMG download.
28# Don't fail here if that happens.
29try {
30 ^update-source-version ghostty-bin $latest --file=./pkgs/by-name/gh/ghostty-bin/package.nix
31} catch {
32 print "Failed to update bin package (is the DMG file uploaded yet?)"
33}
34