Commit 29b89132 authored by Anderson Torres's avatar Anderson Torres
Browse files

ncdu: use zigHook

Also, a cosmetic refactor:

- Reorder parameter listing
- Use rec-less, overlay-style overridable recursive attributes (in effect since
NixOS#119942);
- Remove nested with (according to
https://nix.dev/recipes/best-practices#with-scopes)
- Add `meta.changelog`
parent d695b7ef
Loading
Loading
Loading
Loading
+20 −19
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, zig, ncurses }:

stdenv.mkDerivation rec {
{ lib
, stdenv
, fetchurl
, ncurses
, zigHook
}:

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

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

  XDG_CACHE_HOME="Cache"; # FIXME This should be set in stdenv

  nativeBuildInputs = [
    zig
    zigHook
  ];

  buildInputs = [ ncurses ];

  PREFIX = placeholder "out";

  # Avoid CPU feature impurity, see https://github.com/NixOS/nixpkgs/issues/169461
  ZIG_FLAGS = "-Drelease-safe -Dcpu=baseline";
  buildInputs = [
    ncurses
  ];

  meta = with lib; {
    description = "Disk usage analyzer with an ncurses interface";
  meta = {
    homepage = "https://dev.yorhel.nl/ncdu";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ pSub rodrgz ];
    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 (zigHook.meta) platforms;
  };
}
})
+3 −1
Original line number Diff line number Diff line
@@ -33990,8 +33990,10 @@ with pkgs;
  netcoredbg = callPackage ../development/tools/misc/netcoredbg { };
  ncdu = callPackage ../tools/misc/ncdu {
    zigHook = zigHook.override {
      zig = buildPackages.zig_0_10;
    };
  };
  ncdu_1 = callPackage ../tools/misc/ncdu/1.nix { };