radicle-tui: use fetchFromRadicle

(cherry picked from commit 914c4f2346)
This commit is contained in:
Defelo
2025-08-17 17:43:05 +02:00
parent 8ebf0ecc53
commit 04bd70460a
2 changed files with 9 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
{
lib,
rustPlatform,
fetchgit,
fetchFromRadicle,
stdenv,
libiconv,
zlib,
@@ -13,9 +13,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
pname = "radicle-tui";
version = "0.6.0";
src = fetchgit {
url = "https://seed.radicle.xyz/z39mP9rQAaGmERfUMPULfPUi473tY.git";
rev = "refs/namespaces/z6MkswQE8gwZw924amKatxnNCXA55BMupMmRg7LvJuim2C1V/refs/tags/${finalAttrs.version}";
src = fetchFromRadicle {
seed = "seed.radicle.xyz";
repo = "z39mP9rQAaGmERfUMPULfPUi473tY";
node = "z6MkswQE8gwZw924amKatxnNCXA55BMupMmRg7LvJuim2C1V";
tag = finalAttrs.version;
hash = "sha256-rz9l9GtycqZoROUI6Hn0Fv5Br0YCIrcHlEWLMP4hasQ=";
leaveDotGit = true;
postFetch = ''

View File

@@ -6,13 +6,10 @@ set -euo pipefail
dirname="$(dirname "${BASH_SOURCE[0]}")"
url=$(nix-instantiate --eval --raw -A radicle-tui.src.url)
old_ref=$(nix-instantiate --eval --raw -A radicle-tui.src.rev)
new_ref=$(git ls-remote "$url" 'refs/namespaces/*/refs/tags/*' | cut -f2 | tail -1)
old_node=$(nix-instantiate --eval --raw -A radicle-tui.src.node)
[[ "$old_ref" =~ ^refs/namespaces/([^/]+)/refs/tags/([^/]+)$ ]]
old_node="${BASH_REMATCH[1]}"
[[ "$new_ref" =~ ^refs/namespaces/([^/]+)/refs/tags/([^/]+)$ ]]
ref=$(git ls-remote "$url" 'refs/namespaces/*/refs/tags/*' | cut -f2 | tail -1)
[[ "$ref" =~ ^refs/namespaces/([^/]+)/refs/tags/([^/]+)$ ]]
new_node="${BASH_REMATCH[1]}"
version="${BASH_REMATCH[2]}"