diff --git a/pkgs/by-name/oc/octorus/package.nix b/pkgs/by-name/oc/octorus/package.nix index 3357a2f74baf..1780b6b2cfe6 100644 --- a/pkgs/by-name/oc/octorus/package.nix +++ b/pkgs/by-name/oc/octorus/package.nix @@ -2,23 +2,45 @@ lib, fetchFromGitHub, rustPlatform, - installShellFiles, + writableTmpDirAsHomeHook, + gitMinimal, + gh, + makeWrapper, + versionCheckHook, }: rustPlatform.buildRustPackage (finalAttrs: { pname = "octorus"; - version = "0.3.5"; + version = "0.7.2"; src = fetchFromGitHub { owner = "ushironoko"; repo = "octorus"; tag = "v${finalAttrs.version}"; - hash = "sha256-xVbLh1fe+59KxcZOtCoSAh6O+VdhAyBSGCPP3UZLidA="; + hash = "sha256-qwWCH/Yu9idxaOMNMlSM/RTJgSkpFSyV8VcmnK7DTqI="; }; - cargoHash = "sha256-mOHjNQWeEcoBS4OhPj5RRja+b1PCPAeOM49t7OUtx1s="; + cargoHash = "sha256-wFPeBzbR+/n4gd0y15ToN2XRfsxsCu9if+XT6UTa1GI="; - nativeBuildInputs = [ installShellFiles ]; + nativeBuildInputs = [ makeWrapper ]; + + nativeCheckInputs = [ + gitMinimal + writableTmpDirAsHomeHook + ]; + + postInstall = '' + wrapProgram $out/bin/or \ + --prefix PATH : ${ + lib.makeBinPath [ + gh + gitMinimal + ] + } + ''; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; meta = { description = "TUI PR review tool for GitHub"; @@ -27,7 +49,8 @@ rustPlatform.buildRustPackage (finalAttrs: { license = lib.licenses.mit; maintainers = with lib.maintainers; [ matthiasbeyer + kangazero ]; - mainProgram = "octorus"; + mainProgram = "or"; }; })