1 { fetchFromGitHub, lib, stdenv, perl, makeWrapper
2 , iproute2, acpi, sysstat, alsa-utils
3 , scripts ? [ "bandwidth" "battery" "cpu_usage" "disk" "iface"
4 "load_average" "memory" "volume" "wifi" ]
10 perlscripts = [ "battery" "cpu_usage" "openvpn" "temperature" ];
11 contains_any = l1: l2: 0 < length( intersectLists l1 l2 );
14 stdenv.mkDerivation rec {
15 pname = "i3blocks-gaps";
18 src = fetchFromGitHub {
20 repo = "i3blocks-gaps";
21 rev = "4cfdf93c75f729a2c96d471004d31734e923812f";
22 sha256 = "0v9307ij8xzwdaxay3r75sd2cp453s3qb6q7dy9fks2p6wwqpazi";
25 makeFlags = [ "all" ];
26 installFlags = [ "PREFIX=\${out}" "VERSION=${version}" ];
28 buildInputs = optional (contains_any scripts perlscripts) perl;
29 nativeBuildInputs = [ makeWrapper ];
31 postFixup = optionalString (elem "bandwidth" scripts) ''
32 wrapProgram $out/libexec/i3blocks/bandwidth \
33 --prefix PATH : ${makeBinPath [ iproute2 ]}
34 '' + optionalString (elem "battery" scripts) ''
35 wrapProgram $out/libexec/i3blocks/battery \
36 --prefix PATH : ${makeBinPath [ acpi ]}
37 '' + optionalString (elem "cpu_usage" scripts) ''
38 wrapProgram $out/libexec/i3blocks/cpu_usage \
39 --prefix PATH : ${makeBinPath [ sysstat ]}
40 '' + optionalString (elem "iface" scripts) ''
41 wrapProgram $out/libexec/i3blocks/iface \
42 --prefix PATH : ${makeBinPath [ iproute2 ]}
43 '' + optionalString (elem "volume" scripts) ''
44 wrapProgram $out/libexec/i3blocks/volume \
45 --prefix PATH : ${makeBinPath [ alsa-utils ]}
49 description = "A flexible scheduler for your i3bar blocks -- this is a fork to use with i3-gaps";
50 mainProgram = "i3blocks";
51 homepage = "https://github.com/Airblader/i3blocks-gaps";
52 license = licenses.gpl3;
53 maintainers = with maintainers; [ carlsverre ];
54 platforms = platforms.linux;