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