From 55dec2a4a7f40680a60031468942c7b57ea112fd Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Tue, 11 Feb 2025 16:43:27 +0100 Subject: [PATCH] zoxide: add nushell-integration test --- pkgs/by-name/zo/zoxide/package.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/pkgs/by-name/zo/zoxide/package.nix b/pkgs/by-name/zo/zoxide/package.nix index ac09a23bd3b1..877ea5379d04 100644 --- a/pkgs/by-name/zo/zoxide/package.nix +++ b/pkgs/by-name/zo/zoxide/package.nix @@ -3,10 +3,14 @@ stdenv, fetchFromGitHub, rustPlatform, + runCommandLocal, withFzf ? true, fzf, installShellFiles, libiconv, + testers, + nushell, + zoxide, }: rustPlatform.buildRustPackage (finalAttrs: { @@ -31,6 +35,28 @@ rustPlatform.buildRustPackage (finalAttrs: { cargoHash = "sha256-4BXZ5NnwY2izzJFkPkECKvpuyFWfZ2CguybDDk0GDU0="; + passthru = { + tests = { + version = testers.testVersion { + package = zoxide; + }; + nushell-integration = + runCommandLocal "test-${zoxide.name}-nushell-integration" + { + nativeBuildInputs = [ + nushell + zoxide + ]; + meta.platforms = nushell.meta.platforms; + } + '' + mkdir $out + nu -c "zoxide init nushell | save zoxide.nu" + nu -c "source zoxide.nu" + ''; + }; + }; + postInstall = '' installManPage man/man*/* installShellCompletion --cmd zoxide \