]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - flakes/mypackages/pkgs/bash-libs/default.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / flakes / mypackages / pkgs / bash-libs / default.nix
1 { lib, stdenv, fetchFromGitHub, makeWrapper, shellcheck, bashInteractive, coreutils, gnugrep, gawk, file, aspell, util-linux, gnused }:
2 stdenv.mkDerivation {
3 pname = "bash-libs";
4 version = "master";
5 src = fetchFromGitHub {
6 owner = "foopgp";
7 repo = "bash-libs";
8 rev = "4bf7fe3a488f55beecc74b76e0daf24244bd824f";
9 sha256 = "sha256-8AHUXPd1dQpo1Ce9MT4++eFhJT3X8SYtgaIKbPFUYjM=";
10 };
11
12 buildInputs = [ shellcheck makeWrapper bashInteractive ];
13 phases = [ "checkPhase" "installPhase" ];
14 checkPhase = ''
15 shellcheck bin/*
16 '';
17 installPhase =
18 let binPath = lib.makeBinPath [
19 coreutils file aspell util-linux gnused gnugrep gawk
20 ];
21 in ''
22 mkdir -p $out/bin $out/nix-support $out/share/doc/bash-libs $out/share/bash-libs/include
23
24 for i in $src/bin/*; do
25 name=$(basename $i)
26 cp "$i" $out/share/bash-libs/include
27 patchShebangs $out/share/bash-libs/include/$name
28 makeWrapper $out/share/bash-libs/include/$name $out/bin/$name --set PATH ${binPath}
29 done
30 echo "${binPath}" > $out/nix-support/propagated-build-inputs
31 cp $src/man/* $out/share/doc/bash-libs
32 '';
33 }