nushellPlugins.skim: init at 0.7.0

This commit is contained in:
aftix 2024-10-20 14:35:59 -05:00
parent a7b7cd78c3
commit fbe78043e0
2 changed files with 56 additions and 0 deletions

View File

@ -10,4 +10,5 @@ lib.makeScope newScope (self: with self; {
units = callPackage ./units.nix { };
highlight = callPackage ./highlight.nix { };
dbus = callPackage ./dbus.nix { inherit dbus; nushell_plugin_dbus = self.dbus; };
skim = callPackage ./skim.nix { inherit IOKit CoreFoundation; };
})

View File

@ -0,0 +1,55 @@
{
stdenv,
runCommand,
lib,
rustPlatform,
nix-update-script,
fetchFromGitHub,
IOKit,
CoreFoundation,
nushell,
skim,
}:
rustPlatform.buildRustPackage rec {
pname = "nu_plugin_skim";
version = "0.8.0";
src = fetchFromGitHub {
owner = "idanarye";
repo = pname;
rev = "v${version}";
hash = "sha256-3q2qt35lZ07N8E3p4/BoYX1H4B8qcKXJWnZhdJhgpJE=";
};
cargoHash = "sha256-+RYrQsB8LVjxZsQ7dVDK6GT6nXSM4b+qpILOe0Q2SjA=";
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
IOKit
CoreFoundation
];
passthru = {
updateScript = nix-update-script { };
tests.check =
let
nu = lib.getExe nushell;
plugin = lib.getExe skim;
in
runCommand "${pname}-test" { } ''
touch $out
${nu} -n -c "plugin add --plugin-config $out ${plugin}"
${nu} -n -c "plugin use --plugin-config $out skim"
'';
};
meta = with lib; {
description = "A nushell plugin that adds integrates the skim fuzzy finder";
mainProgram = "nu_plugin_skim";
homepage = "https://github.com/idanarye/nu_plugin_skim";
license = licenses.mit;
maintainers = with maintainers; [ aftix ];
platforms = with platforms; all;
};
}