{ lib, stdenv, fetchurl, ncurses, pkg-config, zig_0_14, zstd, installShellFiles, versionCheckHook, pie ? stdenv.hostPlatform.isDarwin, }: stdenv.mkDerivation (finalAttrs: { pname = "ncdu"; version = "2.9"; src = fetchurl { url = "https://dev.yorhel.nl/download/ncdu-${finalAttrs.version}.tar.gz"; hash = "sha256-dfCsO85PwBLoGYtyUY21F56QMHmFjvzgi5EtXcxwlNM="; }; 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 ryan4yin ]; inherit (zig_0_14.meta) platforms; mainProgram = "ncdu"; }; })