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