about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/du/dust/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/du/dust/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/du/dust/package.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/du/dust/package.nix b/nixpkgs/pkgs/by-name/du/dust/package.nix
new file mode 100644
index 000000000000..fff5b4c3dcc4
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/du/dust/package.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchFromGitHub, rustPlatform, AppKit, installShellFiles }:
+
+rustPlatform.buildRustPackage rec {
+  # 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.
+  pname = "du-dust";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    owner = "bootandy";
+    repo = "dust";
+    rev = "v${version}";
+    hash = "sha256-5X7gRMTUrG6ecZnwExBTadOJo/HByohTMDsgxFmp1HM=";
+    # Remove unicode file names which leads to different checksums on HFS+
+    # vs. other filesystems because of unicode normalisation.
+    postFetch = ''
+      rm -r $out/tests/test_dir_unicode/
+    '';
+  };
+
+  cargoHash = "sha256-uc7jbA8HqsH1bSJgbnUVT/f7F7kZJ4Jf3yyFvseH7no=";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [ AppKit ];
+
+  doCheck = false;
+
+  postInstall = ''
+    installManPage man-page/dust.1
+    installShellCompletion completions/dust.{bash,fish} --zsh completions/_dust
+  '';
+
+  meta = with lib; {
+    description = "du + rust = dust. Like du but more intuitive";
+    homepage = "https://github.com/bootandy/dust";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ infinisil ];
+    mainProgram = "dust";
+  };
+}