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