about summary refs log tree commit diff
path: root/pkgs/by-name/du/dust/package.nix
diff options
context:
space:
mode:
authorAaron Jheng2024-01-20 13:30:49 +0800
committerAaron Jheng2024-02-06 10:04:00 +0800
commite9e9f6adbdfd16267afd7415510a5a37b7250e98 (patch)
tree9839d6bdf163fe01f43c28150f522d943a51420a /pkgs/by-name/du/dust/package.nix
parente1297790f1c4ef4f607a907ba9ce0c4b3a557609 (diff)
dust: rename from du-dust
Diffstat (limited to 'pkgs/by-name/du/dust/package.nix')
-rw-r--r--pkgs/by-name/du/dust/package.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/by-name/du/dust/package.nix b/pkgs/by-name/du/dust/package.nix
new file mode 100644
index 000000000000..fff5b4c3dcc4
--- /dev/null
+++ b/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";
+  };
+}