diff --git a/pkgs/by-name/ra/radicle-explorer/package.nix b/pkgs/by-name/ra/radicle-explorer/package.nix index 15686e7c5a94b..908549bc7d569 100644 --- a/pkgs/by-name/ra/radicle-explorer/package.nix +++ b/pkgs/by-name/ra/radicle-explorer/package.nix @@ -75,7 +75,7 @@ lib.fix ( # radicle-httpd using a more limited sparse checkout we need to carry a # separate hash. src = radicle-httpd.src.override { - hash = "sha256-1OhZ0x21NlZIiTPCRpvdUsx5UmeLecTjVzH8DWllPr8="; + hash = "sha256-PzokSJkcyFDAaih5gekp4GCQMm0sfF7fAK7iZbX1/S4="; sparseCheckout = [ ]; }; @@ -114,6 +114,7 @@ lib.fix ( maintainers = with lib.maintainers; [ tazjin lorenzleutgeb + defelo ]; }; } diff --git a/pkgs/by-name/ra/radicle-httpd/package.nix b/pkgs/by-name/ra/radicle-httpd/package.nix index 7ff24edcab0da..ad75b7928b4b9 100644 --- a/pkgs/by-name/ra/radicle-httpd/package.nix +++ b/pkgs/by-name/ra/radicle-httpd/package.nix @@ -9,25 +9,28 @@ rustPlatform, stdenv, xdg-utils, + versionCheckHook, + nixosTests, }: -rustPlatform.buildRustPackage rec { + +rustPlatform.buildRustPackage (finalAttrs: { pname = "radicle-httpd"; - version = "0.20.0"; - env.RADICLE_VERSION = version; + version = "0.22.0"; + + env.RADICLE_VERSION = finalAttrs.version; # You must update the radicle-explorer source hash when changing this. src = fetchFromRadicle { seed = "seed.radicle.xyz"; repo = "z4V1sjrXqjvFdnCUbxPFqd5p4DtH5"; - node = "z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM"; - tag = "v${version}"; + tag = "releases/${finalAttrs.version}"; sparseCheckout = [ "radicle-httpd" ]; - hash = "sha256-9rJH4ECqOJ9wnYxCbEFHXo3PlhbPdeOnF+Pf1MzX25c="; + hash = "sha256-NA5U+Ac6imbtNabvaeYATfUbbmT48uqWAcbJ+ukJcDs="; }; - sourceRoot = "${src.name}/radicle-httpd"; + sourceRoot = "${finalAttrs.src.name}/radicle-httpd"; - cargoHash = "sha256-1GWWtrSYzTXUAgjeWaxyOuDqTDuTMWleug8SmxTHXbI="; + cargoHash = "sha256-9xyuoOuoFWu7oItQporJuGA8EIfEMrCvPaRPnwYMzmM="; nativeBuildInputs = [ asciidoctor @@ -59,6 +62,15 @@ rustPlatform.buildRustPackage rec { done ''; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru = { + tests = { inherit (nixosTests) radicle; }; + updateScript = ./update.sh; + }; + meta = { description = "Radicle JSON HTTP API Daemon"; longDescription = '' @@ -76,7 +88,8 @@ rustPlatform.buildRustPackage rec { maintainers = with lib.maintainers; [ gador lorenzleutgeb + defelo ]; mainProgram = "radicle-httpd"; }; -} +}) diff --git a/pkgs/by-name/ra/radicle-httpd/update.sh b/pkgs/by-name/ra/radicle-httpd/update.sh new file mode 100755 index 0000000000000..212d9bf7210cf --- /dev/null +++ b/pkgs/by-name/ra/radicle-httpd/update.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p coreutils gnugrep common-updater-scripts nix-update + +version=$(list-git-tags | grep -oP '^releases/\K\d+\.\d+\.\d+$' | sort -rV | head -1) +nix-update --version="$version" radicle-httpd +nix-update --version=skip radicle-explorer