Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkgs/shells/nushell/plugins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lib.makeScope newScope (
nushell_plugin_dbus = self.dbus;
};
skim = callPackage ./skim.nix { inherit IOKit CoreFoundation; };
strutils = callPackage ./strutils.nix { inherit IOKit CoreFoundation; };
}
// lib.optionalAttrs config.allowAliases {
regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
Expand Down
55 changes: 55 additions & 0 deletions pkgs/shells/nushell/plugins/strutils.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,
strutils,
}:
rustPlatform.buildRustPackage rec {
pname = "nu_plugin_strutils";
version = "0.10.0";

src = fetchFromGitHub {
owner = "fdncred";
repo = pname;
tag = version;
hash = "sha256-JXlxQtTNOAYf+ZSsiwKe4jKdj2eF0QLslhTRI5rwf+s=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-9bUGg5dqky20wwWjUMo99FuueFNzxDs15wz6HV2yB3I=";

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 strutils;
in
runCommand "${pname}-test" { } ''
touch $out
${nu} -n -c "plugin add --plugin-config $out ${plugin}"
${nu} -n -c "plugin use --plugin-config $out strutils"
'';
};

meta = with lib; {
description = "A nushell plugin that implements additional string utilities beyond the built-in commands";
mainProgram = "nu_plugin_strutils";
homepage = "https://github.com/fdncred/nu_plugin_strutils";
license = licenses.mit;
maintainers = [ maintainers.aftix ];
platforms = platforms.all;
};
}