nixpkgs/pkgs/by-name/nc/ncdu/package.nix
2025-05-28 16:08:46 +02:00

59 lines
1.1 KiB
Nix

{
lib,
stdenv,
fetchurl,
ncurses,
pkg-config,
zig_0_14,
zstd,
installShellFiles,
versionCheckHook,
pie ? stdenv.hostPlatform.isDarwin,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "ncdu";
version = "2.8.2";
src = fetchurl {
url = "https://dev.yorhel.nl/download/ncdu-${finalAttrs.version}.tar.gz";
hash = "sha256-Ai+nZdNaeXl6zcgMgxcH30PJo7pg0a4+bqTMG3osAT0=";
};
nativeBuildInputs = [
zig_0_14.hook
installShellFiles
pkg-config
];
buildInputs = [
ncurses
zstd
];
zigBuildFlags = lib.optional pie "-Dpie=true";
postInstall = ''
installManPage ncdu.1
'';
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = ./update.sh;
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
defelo
];
inherit (zig_0_14.meta) platforms;
mainProgram = "ncdu";
};
})