diff --git a/pkgs/by-name/we/wezterm/package.nix b/pkgs/by-name/we/wezterm/package.nix index a8b8f756a1a4..aaf098d19d35 100644 --- a/pkgs/by-name/we/wezterm/package.nix +++ b/pkgs/by-name/we/wezterm/package.nix @@ -16,7 +16,6 @@ python3, runCommand, rustPlatform, - unstableGitUpdater, vulkan-loader, wayland, wezterm, @@ -29,14 +28,14 @@ rustPlatform.buildRustPackage rec { pname = "wezterm"; - version = "0-unstable-2025-06-24"; + version = "0-unstable-2025-07-10"; src = fetchFromGitHub { owner = "wez"; repo = "wezterm"; - rev = "2deb317ec069b8f94ec1282253faaa71a8d997fc"; + rev = "85c587f9f3d8be49dfa252da116fc9ca290df113"; fetchSubmodules = true; - hash = "sha256-danJcaG4ZyMbqR+4xaVOVM7a+4Sehq5cum40iRt/HQ8="; + hash = "sha256-hyyKC5BXeIbgP+bXxtvIz1LZUDoUJ6+em/PrX/TEg4k="; }; postPatch = '' @@ -59,7 +58,7 @@ rustPlatform.buildRustPackage rec { # https://github.com/wezterm/wezterm/blob/main/nix/flake.nix#L134 auditable = false; - cargoHash = "sha256-uYx5OykWHN4B73rXWMYg3Sl7B+o7uFJMyAFiLMlLCsA="; + cargoHash = "sha256-chMbDMT8UWaiGovlzYn1UD8VFqb9UYHMDDx/A62wQsY="; nativeBuildInputs = [ installShellFiles @@ -152,10 +151,7 @@ rustPlatform.buildRustPackage rec { #terminal-emulators = nixosTests.terminal-emulators.wezterm; }; - # upstream tags are composed with timestamp+commit, e.g.: - # 20240203-110809-5046fc22 - # doesn't make much sense if we are following unstable - updateScript = unstableGitUpdater { hardcodeZeroVersion = true; }; + updateScript = ./update.sh; }; meta = with lib; { diff --git a/pkgs/by-name/we/wezterm/update.sh b/pkgs/by-name/we/wezterm/update.sh new file mode 100755 index 000000000000..d04296c9bab3 --- /dev/null +++ b/pkgs/by-name/we/wezterm/update.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq git nix-prefetch-git common-updater-scripts gnused nix-update + +set -euo pipefail + +OWNER="wez" +REPO="wezterm" + +NIXPKGS_ROOT=$(git rev-parse --show-toplevel) +PACKAGE_NIX_ATTR_PATH="wezterm" + +# For wezterm, the version is 0-unstable-YYYY-MM-DD, so we need to get the commit date +# from the latest commit, not the release tag. +# We also need the latest commit SHA for the rev. + +LATEST_COMMIT_INFO=$(curl ${GITHUB_TOKEN:+--user ":$GITHUB_TOKEN"} --location --silent "https://api.github.com/repos/$OWNER/$REPO/commits/HEAD") +LATEST_REV=$(echo "$LATEST_COMMIT_INFO" | jq --raw-output '.sha') +COMMIT_DATE=$(echo "$LATEST_COMMIT_INFO" | jq --raw-output '.commit.author.date' | cut -d 'T' -f 1) + +NEW_VERSION="0-unstable-$COMMIT_DATE" + +FETCH_JSON=$(nix-prefetch-git --url "https://github.com/$OWNER/$REPO" --rev "$LATEST_REV" --fetch-submodules) +FETCH_HASH=$(echo "$FETCH_JSON" | jq --raw-output .hash) + +(cd "$NIXPKGS_ROOT" && nix-update wezterm) +(cd "$NIXPKGS_ROOT" && update-source-version "$PACKAGE_NIX_ATTR_PATH" "$NEW_VERSION" "$FETCH_HASH" --rev="$LATEST_REV") + +sed -i -e "s#version = \".*\"#version = \"$NEW_VERSION\"#" "$NIXPKGS_ROOT/pkgs/by-name/we/wezterm/package.nix" + +echo "Wezterm update script finished."