From 450e6f4683ca28df136425bb00419db692df536c Mon Sep 17 00:00:00 2001 From: "Adam C. Stephens" Date: Tue, 14 Jul 2026 10:52:48 -0400 Subject: [PATCH] outline: fix updateScript --- pkgs/by-name/ou/outline/package.nix | 3 +-- pkgs/by-name/ou/outline/update.sh | 41 +++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100755 pkgs/by-name/ou/outline/update.sh diff --git a/pkgs/by-name/ou/outline/package.nix b/pkgs/by-name/ou/outline/package.nix index 468cf3a78012..89ff4c7ca055 100644 --- a/pkgs/by-name/ou/outline/package.nix +++ b/pkgs/by-name/ou/outline/package.nix @@ -3,7 +3,6 @@ lib, fetchFromGitHub, makeWrapper, - nix-update-script, nodejs, nixosTests, yarn-berry_4, @@ -70,7 +69,7 @@ stdenv.mkDerivation (finalAttrs: { tests = { basic-functionality = nixosTests.outline; }; - updateScript = nix-update-script { }; + updateScript = ./update.sh; # alias for nix-update to be able to find and update this attribute inherit (finalAttrs) offlineCache; }; diff --git a/pkgs/by-name/ou/outline/update.sh b/pkgs/by-name/ou/outline/update.sh new file mode 100755 index 000000000000..b87238817a8d --- /dev/null +++ b/pkgs/by-name/ou/outline/update.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p common-updater-scripts coreutils curl git gnused jq nix-prefetch-github yarn-berry.yarn-berry-fetcher + +set -o errexit -o nounset -o pipefail + +package="outline" +owner="outline" +repo="outline" +package_dir="pkgs/by-name/${package::2}/${package}" + +# +# package +# + +current_version=$(nix-instantiate --eval --expr "with import ./. {}; ${package}.version" --raw) +echo "Current version: ${current_version}" + +latest_version=$(curl --silent "https://api.github.com/repos/${owner}/${repo}/releases" | jq '.[0].tag_name' --raw-output | sed 's/^v//') +echo "Latest version: ${latest_version}" + +if [[ "${current_version}" == "${latest_version}" ]]; then + echo "${package} is up to date: ${current_version}" + exit 0 +fi + +echo "Updating ${package} from ${current_version} to ${latest_version}…" + +update-source-version "${package}" "${latest_version}" + +# +# yarn deps +# + +echo "Regenerating missing-hashes.json…" +src_path=$(nix-build --attr "${package}.src" --no-link) +yarn-berry-fetcher missing-hashes "${src_path}/yarn.lock" >"${package_dir}/missing-hashes.json" + +echo "Updating offline cache hash…" +update-source-version "${package}" --ignore-same-version --source-key=offlineCache + +echo "Done."