about summary refs log tree commit diff
path: root/pkgs/tools/misc/ncdu/default.nix
blob: abde0b0d79e1615d427889b9244ed27331bf422f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ lib
, stdenv
, fetchurl
, ncurses
, zig
, installShellFiles
, testers
, pie ? stdenv.hostPlatform.isDarwin
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "ncdu";
  version = "2.5";

  src = fetchurl {
    url = "https://dev.yorhel.nl/download/ncdu-${finalAttrs.version}.tar.gz";
    hash = "sha256-f0neJQJKurGvH/IrO4VCwNFY4Bj+DpYHT9lLDh5tMaU=";
  };

  nativeBuildInputs = [
    zig.hook
    installShellFiles
  ];

  buildInputs = [
    ncurses
  ];

  zigBuildFlags = lib.optional pie "-Dpie=true";

  postInstall = ''
    installManPage ncdu.1
  '';

  passthru.tests.version = testers.testVersion {
    package = finalAttrs.finalPackage;
  };

  meta = {
    homepage = "https://dev.yorhel.nl/ncdu";
    description = "Disk usage analyzer with an ncurses interface";
    changelog = "https://dev.yorhel.nl/ncdu/changes2";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ pSub rodrgz ];
    inherit (zig.meta) platforms;
    mainProgram = "ncdu";
  };
})