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`
This commit is contained in:
Anderson Torres
2023-07-23 21:28:46 -03:00
parent d695b7ef5b
commit 29b89132fb
2 changed files with 22 additions and 19 deletions
+19 -18
View File
@@ -1,32 +1,33 @@
{ lib, stdenv, fetchurl, zig, ncurses }:
{ lib
, stdenv
, fetchurl
, ncurses
, zigHook
}:
stdenv.mkDerivation rec {
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 ];
buildInputs = [
ncurses
];
PREFIX = placeholder "out";
# Avoid CPU feature impurity, see https://github.com/NixOS/nixpkgs/issues/169461
ZIG_FLAGS = "-Drelease-safe -Dcpu=baseline";
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
View File
@@ -33990,7 +33990,9 @@ with pkgs;
netcoredbg = callPackage ../development/tools/misc/netcoredbg { };
ncdu = callPackage ../tools/misc/ncdu {
zig = buildPackages.zig_0_10;
zigHook = zigHook.override {
zig = buildPackages.zig_0_10;
};
};
ncdu_1 = callPackage ../tools/misc/ncdu/1.nix { };