radicle-httpd: add updateScript

This commit is contained in:
Defelo
2026-01-07 21:48:31 +01:00
parent f71fbc8ad4
commit f1f7c8bfdd
2 changed files with 21 additions and 0 deletions
@@ -66,6 +66,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = ./update.sh;
meta = {
description = "Radicle JSON HTTP API Daemon";
longDescription = ''
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils gnused gitMinimal nix-update
set -euo pipefail
dirname="$(dirname "${BASH_SOURCE[0]}")"
url=$(nix-instantiate --eval --raw -A radicle-httpd.src.url)
old_node=$(nix-instantiate --eval --raw -A radicle-httpd.src.node)
ref=$(git ls-remote "$url" 'refs/namespaces/*/refs/tags/v0*' \
| cut -f2 | grep -Ev '\^\{\}$' | sort -t/ -k6rV | head -1)
[[ "$ref" =~ ^refs/namespaces/([^/]+)/refs/tags/v([^/]+)$ ]]
new_node="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}"
sed -i "s/${old_node}/${new_node}/g" "${dirname}/package.nix"
nix-update --version="$version" radicle-httpd
nix-update --version=skip radicle-explorer