2017-05-30 18:30:41 +00:00
|
|
|
{ fetchFromGitHub, stdenv, perl, makeWrapper
|
|
|
|
, iproute, acpi, sysstat, alsaUtils
|
|
|
|
, scripts ? [ "bandwidth" "battery" "cpu_usage" "disk" "iface"
|
|
|
|
"load_average" "memory" "volume" "wifi" ]
|
|
|
|
}:
|
2016-07-22 06:37:01 +00:00
|
|
|
|
2017-05-30 18:30:41 +00:00
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
perlscripts = [ "battery" "cpu_usage" "openvpn" "temperature" ];
|
|
|
|
contains_any = l1: l2: 0 < length( intersectLists l1 l2 );
|
|
|
|
|
|
|
|
in
|
2016-07-22 06:37:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "i3blocks-gaps-${version}";
|
|
|
|
version = "1.4";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Airblader";
|
|
|
|
repo = "i3blocks-gaps";
|
|
|
|
rev = "4cfdf93c75f729a2c96d471004d31734e923812f";
|
|
|
|
sha256 = "0v9307ij8xzwdaxay3r75sd2cp453s3qb6q7dy9fks2p6wwqpazi";
|
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = "all";
|
|
|
|
installFlags = "PREFIX=\${out} VERSION=${version}";
|
|
|
|
|
2017-05-30 18:30:41 +00:00
|
|
|
buildInputs = optional (contains_any scripts perlscripts) perl;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/libexec/i3blocks/bandwidth \
|
|
|
|
--prefix PATH : ${makeBinPath (optional (elem "bandwidth" scripts) iproute)}
|
|
|
|
wrapProgram $out/libexec/i3blocks/battery \
|
|
|
|
--prefix PATH : ${makeBinPath (optional (elem "battery" scripts) acpi)}
|
|
|
|
wrapProgram $out/libexec/i3blocks/cpu_usage \
|
|
|
|
--prefix PATH : ${makeBinPath (optional (elem "cpu_usage" scripts) sysstat)}
|
|
|
|
wrapProgram $out/libexec/i3blocks/iface \
|
|
|
|
--prefix PATH : ${makeBinPath (optional (elem "iface" scripts) iproute)}
|
|
|
|
wrapProgram $out/libexec/i3blocks/volume \
|
|
|
|
--prefix PATH : ${makeBinPath (optional (elem "volume" scripts) alsaUtils)}
|
|
|
|
'';
|
|
|
|
|
2016-07-22 06:37:01 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A flexible scheduler for your i3bar blocks -- this is a fork to use with i3-gaps";
|
|
|
|
homepage = https://github.com/Airblader/i3blocks-gaps;
|
|
|
|
license = licenses.gpl3;
|
2017-01-20 14:43:34 +00:00
|
|
|
maintainers = with maintainers; [ carlsverre ];
|
2016-08-12 03:21:55 +00:00
|
|
|
platforms = platforms.linux;
|
2016-07-22 06:37:01 +00:00
|
|
|
};
|
|
|
|
}
|