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" ]
8 perlscripts = [ "battery" "cpu_usage" "openvpn" "temperature" ];
9 contains_any = l1: l2: 0 < lib.length( lib.intersectLists l1 l2 );
12 stdenv.mkDerivation rec {
13 pname = "i3blocks-gaps";
16 src = fetchFromGitHub {
18 repo = "i3blocks-gaps";
19 rev = "4cfdf93c75f729a2c96d471004d31734e923812f";
20 sha256 = "0v9307ij8xzwdaxay3r75sd2cp453s3qb6q7dy9fks2p6wwqpazi";
23 makeFlags = [ "all" ];
24 installFlags = [ "PREFIX=\${out}" "VERSION=${version}" ];
26 buildInputs = lib.optional (contains_any scripts perlscripts) perl;
27 nativeBuildInputs = [ makeWrapper ];
29 postFixup = lib.optionalString (lib.elem "bandwidth" scripts) ''
30 wrapProgram $out/libexec/i3blocks/bandwidth \
31 --prefix PATH : ${lib.makeBinPath [ iproute2 ]}
32 '' + lib.optionalString (lib.elem "battery" scripts) ''
33 wrapProgram $out/libexec/i3blocks/battery \
34 --prefix PATH : ${lib.makeBinPath [ acpi ]}
35 '' + lib.optionalString (lib.elem "cpu_usage" scripts) ''
36 wrapProgram $out/libexec/i3blocks/cpu_usage \
37 --prefix PATH : ${lib.makeBinPath [ sysstat ]}
38 '' + lib.optionalString (lib.elem "iface" scripts) ''
39 wrapProgram $out/libexec/i3blocks/iface \
40 --prefix PATH : ${lib.makeBinPath [ iproute2 ]}
41 '' + lib.optionalString (lib.elem "volume" scripts) ''
42 wrapProgram $out/libexec/i3blocks/volume \
43 --prefix PATH : ${lib.makeBinPath [ alsa-utils ]}
47 description = "Flexible scheduler for your i3bar blocks -- this is a fork to use with i3-gaps";
48 mainProgram = "i3blocks";
49 homepage = "https://github.com/Airblader/i3blocks-gaps";
50 license = licenses.gpl3;
51 maintainers = with maintainers; [ carlsverre ];
52 platforms = platforms.linux;