mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 13:00:23 +00:00
fclones: add shell completions
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
fetchFromGitHub,
|
||||
stdenv,
|
||||
darwin,
|
||||
installShellFiles,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
@@ -23,6 +24,7 @@ rustPlatform.buildRustPackage rec {
|
||||
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.apple_sdk_11_0.frameworks.AppKit
|
||||
];
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
# device::test_physical_device_name test fails on Darwin
|
||||
doCheck = !stdenv.hostPlatform.isDarwin;
|
||||
@@ -32,6 +34,15 @@ rustPlatform.buildRustPackage rec {
|
||||
"--skip=cache::test::return_none_if_different_transform_was_used"
|
||||
];
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
# setting PATH required so completion script doesn't use full path
|
||||
export PATH="$PATH:$out/bin"
|
||||
installShellCompletion --cmd $pname \
|
||||
--bash <(fclones complete bash) \
|
||||
--fish <(fclones complete fish) \
|
||||
--zsh <(fclones complete zsh)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Efficient Duplicate File Finder and Remover";
|
||||
homepage = "https://github.com/pkolaczk/fclones";
|
||||
|
||||
Reference in New Issue
Block a user