diff --git a/pkgs/shells/nushell/plugins/default.nix b/pkgs/shells/nushell/plugins/default.nix index df15b6aadd151..ebab023b32ef6 100644 --- a/pkgs/shells/nushell/plugins/default.nix +++ b/pkgs/shells/nushell/plugins/default.nix @@ -58,6 +58,7 @@ lib.makeScope newScope ( skim = callPackage ./skim.nix { }; semver = callPackage ./semver.nix { }; hcl = callPackage ./hcl.nix { }; + file = callPackage ./file.nix { }; } // lib.optionalAttrs config.allowAliases { regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release."; diff --git a/pkgs/shells/nushell/plugins/file.nix b/pkgs/shells/nushell/plugins/file.nix new file mode 100644 index 0000000000000..8fd664d2fd237 --- /dev/null +++ b/pkgs/shells/nushell/plugins/file.nix @@ -0,0 +1,31 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + nix-update-script, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "nu_plugin_file"; + version = "0.16.0"; + + src = fetchFromGitHub { + owner = "fdncred"; + repo = "nu_plugin_file"; + tag = "v${finalAttrs.version}"; + hash = "sha256-n/E7CpRLZvg+NWI+n3VzE+qrTKrpBbFNfSsHZEqRNiU="; + }; + + cargoHash = "sha256-rtzFq4iKzBnICwdhkoK7TSl6fgRUUXyedboZGmSM7qQ="; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Nushell plugin that identifies file types"; + mainProgram = "nu_plugin_file"; + homepage = "https://github.com/fdncred/nu_plugin_file"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ timon ]; + platforms = lib.platforms.linux; + }; +})