aboutsummaryrefslogtreecommitdiff
path: root/flakes/mypackages/pkgs/bash-libs
diff options
context:
space:
mode:
Diffstat (limited to 'flakes/mypackages/pkgs/bash-libs')
-rw-r--r--flakes/mypackages/pkgs/bash-libs/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/flakes/mypackages/pkgs/bash-libs/default.nix b/flakes/mypackages/pkgs/bash-libs/default.nix
new file mode 100644
index 0000000..991c9d2
--- /dev/null
+++ b/flakes/mypackages/pkgs/bash-libs/default.nix
@@ -0,0 +1,33 @@
1{ lib, stdenv, fetchFromGitHub, makeWrapper, shellcheck, bashInteractive, coreutils, gnugrep, gawk, file, aspell, util-linux, gnused }:
2stdenv.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}