Skip to content

Commit

Permalink
nushellPlugins.skim: init at 0.7.0 (#350136)
Browse files Browse the repository at this point in the history
  • Loading branch information
dywedir authored Oct 22, 2024
2 parents da62a01 + fbe7804 commit 013136e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/shells/nushell/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ lib.makeScope newScope (self: with self; {
units = callPackage ./units.nix { inherit IOKit Foundation; };
highlight = callPackage ./highlight.nix { inherit IOKit Foundation; };
dbus = callPackage ./dbus.nix { inherit dbus; nushell_plugin_dbus = self.dbus; };
skim = callPackage ./skim.nix { inherit IOKit CoreFoundation; };
})
55 changes: 55 additions & 0 deletions pkgs/shells/nushell/plugins/skim.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}

0 comments on commit 013136e

Please sign in to comment.