{ stdenvNoCC, zig, fetchgit, lib, }: stdenvNoCC.mkDerivation { pname = "abbr-dir"; version = "0.1.0"; src = fetchgit { url = "https://github.com/char/abbr-dir.git"; rev = "refs/heads/main"; hash = "sha256-PkCX6W/c5ZnczDICBFe7bLCJZecvb+9dPeVOeJr+yjE="; }; nativeBuildInputs = [ zig ]; dontConfigure = true; buildPhase = '' export ZIG_GLOBAL_CACHE_DIR=$TMPDIR/zig-cache zig build -Doptimize=ReleaseSafe ''; installPhase = '' mkdir -p $out/bin cp zig-out/bin/abbr-dir $out/bin/ ''; meta = with lib; { description = "Abbreviate a path for display in a shell prompt"; homepage = "https://github.com/char/abbr-dir"; mainProgram = "abbr-dir"; platforms = platforms.linux ++ platforms.darwin; }; }