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 @@ -10,6 +10,7 @@ lib.makeScope newScope (self: with self; {
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; };
file = callPackage ./file.nix { inherit IOKit CoreFoundation; };
} // lib.optionalAttrs config.allowAliases {
regex = throw "`nu_plugin_regex` is no longer compatible with the current Nushell release.";
})
48 changes: 48 additions & 0 deletions pkgs/shells/nushell/plugins/file.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
stdenv,
lib,
rustPlatform,
pkg-config,
nix-update-script,
fetchFromGitHub,
CoreFoundation,
IOKit,
}:

rustPlatform.buildRustPackage rec {
pname = "nushell_plugin_file";
version = "0.13.0";

src = fetchFromGitHub {
repo = "nu_plugin_file";
owner = "fdncred";
tag = "v${version}";
hash = "sha256-cMDkhNPIfkJb01fBSt2fCCdg/acdzak66qMRp0zuJzc=";
};

useFetchCargoVendor = true;
cargoHash = "sha256-s2Sw8NDVJZoZsnNeGGCXb64WFb3ivO9TxBYFcjLVOZI=";

nativeBuildInputs = [ pkg-config ] ++ lib.optionals stdenv.cc.isClang [ rustPlatform.bindgenHook ];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
CoreFoundation
IOKit
];
cargoBuildFlags = [ "--package nu_plugin_file" ];

checkPhase = ''
cargo test
'';

passthru.updateScript = nix-update-script { };

meta = {
description = "A nushell plugin that will inspect a file and return information based on it's magic number.";
mainProgram = "nu_plugin_file";
homepage = "https://github.com/fdncred/nu_plugin_file";
license = lib.licenses.agpl3Only;
maintainers = [ lib.maintainers.mgttlinger ];
platforms = lib.platforms.all;
changelog = "https://github.com/fdncred/nu_plugin_file/releases/tag/v${version}/CHANGELOG.md";
};
}