diff --git a/pkgs/by-name/ra/radicle-node/package.nix b/pkgs/by-name/ra/radicle-node/package.nix index d1e984a74701..71d01408459e 100644 --- a/pkgs/by-name/ra/radicle-node/package.nix +++ b/pkgs/by-name/ra/radicle-node/package.nix @@ -7,27 +7,24 @@ lib, makeBinaryWrapper, man-db, - nixos, nixosTests, openssh, - radicle-node, runCommand, rustPlatform, stdenv, - testers, xdg-utils, versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "radicle-node"; - version = "1.5.0"; + version = "1.6.0"; src = fetchFromRadicle { seed = "seed.radicle.xyz"; repo = "z3gqcJUoA1n9HaHKufZs5FCSGazv5"; tag = "releases/${finalAttrs.version}"; - hash = "sha256-/dWeG2jKCnfg7fwPP+BbRmEvM7rCppGYh2aeftcg3SY="; + hash = "sha256-j7GTtx9Dq3xZeEsgIlaRq1Vbc9aJfn22WCkNTGjvH1Q="; leaveDotGit = true; postFetch = '' git -C $out rev-parse HEAD > $out/.git_head @@ -36,7 +33,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; }; - cargoHash = "sha256-4URBtN5lyzFPaLJUf/HPAL2ugRUa6sZhpDeiFR0W7cc="; + cargoHash = "sha256-59RyfSUJNoQ7EtQK3OSYOIO/YVEjeeM9ovbojHFX4pI="; env.RADICLE_VERSION = finalAttrs.version; @@ -89,6 +86,12 @@ rustPlatform.buildRustPackage (finalAttrs: { asciidoctor -d manpage -b manpage $page installManPage ''${page::-5} done + '' + + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd rad \ + --bash <($out/bin/rad completion bash) \ + --fish <($out/bin/rad completion fish) \ + --zsh <($out/bin/rad completion zsh) ''; nativeInstallCheckInputs = [ versionCheckHook ]; @@ -110,53 +113,34 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; passthru.updateScript = ./update.sh; - passthru.tests = - let - package = radicle-node; - in - { - basic = - runCommand "${package.name}-basic-test" - { - nativeBuildInputs = [ - jq - openssh - radicle-node - ]; - } - '' - set -e - export RAD_HOME="$PWD/.radicle" - mkdir -p "$RAD_HOME/keys" - ssh-keygen -t ed25519 -N "" -f "$RAD_HOME/keys/radicle" > /dev/null - jq -n '.node.alias |= "nix"' > "$RAD_HOME/config.json" + passthru.tests = { + basic = + runCommand "radicle-node-basic-test" + { + nativeBuildInputs = [ + jq + openssh + finalAttrs.finalPackage + ]; + } + '' + set -e + export RAD_HOME="$PWD/.radicle" + mkdir -p "$RAD_HOME/keys" + ssh-keygen -t ed25519 -N "" -f "$RAD_HOME/keys/radicle" > /dev/null + jq -n '.node.alias |= "nix"' > "$RAD_HOME/config.json" - rad config > /dev/null - rad debug | jq -e ' - (.sshVersion | contains("${openssh.version}")) - and - (.gitVersion | contains("${gitMinimal.version}")) - ' + rad config > /dev/null + rad debug | jq -e ' + (.sshVersion | contains("${openssh.version}")) + and + (.gitVersion | contains("${gitMinimal.version}")) + ' - touch $out - ''; - nixos-build = lib.recurseIntoAttrs { - checkConfig-success = - (nixos { - services.radicle.settings = { - node.alias = "foo"; - }; - }).config.services.radicle.configFile; - checkConfig-failure = - testers.testBuildFailure - (nixos { - services.radicle.settings = { - node.alias = null; - }; - }).config.services.radicle.configFile; - }; - nixos-run = nixosTests.radicle; - }; + touch $out + ''; + nixos-run = nixosTests.radicle; + }; meta = { description = "Radicle node and CLI for decentralized code collaboration";