2023-02-02 18:25:31 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, rustPlatform, AppKit, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2024-02-29 20:09:43 +00:00
|
|
|
# Originally, this package was under the attribute `du-dust`, since `dust` was taken.
|
|
|
|
# Since then, `dust` has been freed up, allowing this package to take that attribute.
|
|
|
|
# However in order for tools like `nix-env` to detect package updates, keep `du-dust` for pname.
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "du-dust";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.9.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bootandy";
|
|
|
|
repo = "dust";
|
|
|
|
rev = "v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-5X7gRMTUrG6ecZnwExBTadOJo/HByohTMDsgxFmp1HM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
# Remove unicode file names which leads to different checksums on HFS+
|
|
|
|
# vs. other filesystems because of unicode normalisation.
|
2022-06-16 17:23:12 +00:00
|
|
|
postFetch = ''
|
2021-02-13 14:23:35 +00:00
|
|
|
rm -r $out/tests/test_dir_unicode/
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
cargoHash = "sha256-uc7jbA8HqsH1bSJgbnUVT/f7F7kZJ4Jf3yyFvseH7no=";
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ AppKit ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage man-page/dust.1
|
|
|
|
installShellCompletion completions/dust.{bash,fish} --zsh completions/_dust
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "du + rust = dust. Like du but more intuitive";
|
|
|
|
homepage = "https://github.com/bootandy/dust";
|
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ infinisil ];
|
2021-07-18 21:22:44 +00:00
|
|
|
mainProgram = "dust";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|