From b9e46af9e746ca496faaf1259f650b6565f1fac0 Mon Sep 17 00:00:00 2001 From: Tom van Dijk <18gatenmaker6@gmail.com> Date: Sat, 28 Jun 2025 00:28:21 +0200 Subject: [PATCH] nushellPlugins.skim: refactor (cherry picked from commit d22a7867e0843d56db7b58f1adc46256ab15244e) --- pkgs/shells/nushell/plugins/skim.nix | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/pkgs/shells/nushell/plugins/skim.nix b/pkgs/shells/nushell/plugins/skim.nix index bdc459aec076..e66c78353274 100644 --- a/pkgs/shells/nushell/plugins/skim.nix +++ b/pkgs/shells/nushell/plugins/skim.nix @@ -9,21 +9,20 @@ skim, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "nu_plugin_skim"; version = "0.14.0"; src = fetchFromGitHub { owner = "idanarye"; - repo = pname; - tag = "v${version}"; + repo = "nu_plugin_skim"; + tag = "v${finalAttrs.version}"; hash = "sha256-bH+llby34lqnxZXdtTEBPiw50tvvY72h+YkRRdiXXTc="; }; - useFetchCargoVendor = true; cargoHash = "sha256-VTnaEqIuvTalemVhc/GJnTCQh1DCWQrtoo7oGJBZMXs="; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ]; + nativeBuildInputs = lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ]; passthru = { updateScript = nix-update-script { }; @@ -32,19 +31,18 @@ rustPlatform.buildRustPackage rec { nu = lib.getExe nushell; plugin = lib.getExe skim; in - runCommand "${pname}-test" { } '' + runCommand "${finalAttrs.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; { + meta = { 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 = platforms.all; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ aftix ]; }; -} +})