1{ stdenv, lib, fetchFromGitHub, makeWrapper
2, curl, netcat, python, bind, iproute, bc, gitMinimal }:
3let
4 version = "1.17.3";
5 deps = lib.makeBinPath [
6 curl
7 python
8 bind.dnsutils
9 iproute
10 bc
11 gitMinimal
12 ];
13in
14stdenv.mkDerivation {
15 name = "bashSnippets-${version}";
16
17 src = fetchFromGitHub {
18 owner = "alexanderepstein";
19 repo = "Bash-Snippets";
20 rev = "v${version}";
21 sha256 = "1xdjk8bjh7l6h7gdqrra1dh4wdq89wmd0jsirsvqa3bmcsb2wz1r";
22 };
23
24 buildInputs = [ makeWrapper ];
25
26 patchPhase = ''
27 patchShebangs install.sh
28 substituteInPlace install.sh --replace /usr/local "$out"
29 '';
30
31 dontBuild = true;
32
33 installPhase = ''
34 mkdir -p "$out"/bin "$out"/share/man/man1
35 ./install.sh all
36 for file in "$out"/bin/*; do
37 wrapProgram "$file" --prefix PATH : "${deps}"
38 done
39 '';
40
41 meta = with lib; {
42 description = "A collection of small bash scripts for heavy terminal users";
43 homepage = https://github.com/alexanderepstein/Bash-Snippets;
44 license = licenses.mit;
45 maintainers = with maintainers; [ infinisil ];
46 platforms = platforms.unix;
47 };
48}