Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pkgs/by-name/ra/radicle-explorer/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [ ];
};

Expand Down Expand Up @@ -114,6 +114,7 @@ lib.fix (
maintainers = with lib.maintainers; [
tazjin
lorenzleutgeb
defelo
];
};
}
Expand Down
31 changes: 22 additions & 9 deletions pkgs/by-name/ra/radicle-httpd/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = ''
Expand All @@ -76,7 +88,8 @@ rustPlatform.buildRustPackage rec {
maintainers = with lib.maintainers; [
gador
lorenzleutgeb
defelo
];
mainProgram = "radicle-httpd";
};
}
})
6 changes: 6 additions & 0 deletions pkgs/by-name/ra/radicle-httpd/update.sh
Original file line number Diff line number Diff line change
@@ -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
Loading