char/flake

nixos flake

git clone https://git.t4t.associates/char/flake

Charlotte Somdotfiles.nix: set up abbr-dirbbd1227

main
770 B35 linesraw
1{
2  stdenvNoCC,
3  zig,
4  fetchgit,
5  lib,
6}:
7stdenvNoCC.mkDerivation {
8  pname = "abbr-dir";
9  version = "0.1.0";
10
11  src = fetchgit {
12    url = "https://github.com/char/abbr-dir.git";
13    rev = "refs/heads/main";
14    hash = "sha256-PkCX6W/c5ZnczDICBFe7bLCJZecvb+9dPeVOeJr+yjE=";
15  };
16
17  nativeBuildInputs = [ zig ];
18
19  dontConfigure = true;
20  buildPhase = ''
21    export ZIG_GLOBAL_CACHE_DIR=$TMPDIR/zig-cache
22    zig build -Doptimize=ReleaseSafe
23  '';
24  installPhase = ''
25    mkdir -p $out/bin
26    cp zig-out/bin/abbr-dir $out/bin/
27  '';
28
29  meta = with lib; {
30    description = "Abbreviate a path for display in a shell prompt";
31    homepage = "https://github.com/char/abbr-dir";
32    mainProgram = "abbr-dir";
33    platforms = platforms.linux ++ platforms.darwin;
34  };
35}