1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00
nixpkgs/pkgs/applications/window-managers/i3/blocks-gaps.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.9 KiB
Nix
Raw Normal View History

{ fetchFromGitHub, lib, stdenv, perl, makeWrapper
, iproute2, acpi, sysstat, alsa-utils
, scripts ? [ "bandwidth" "battery" "cpu_usage" "disk" "iface"
"load_average" "memory" "volume" "wifi" ]
}:
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 );
in
stdenv.mkDerivation rec {
pname = "i3blocks-gaps";
version = "1.4";
src = fetchFromGitHub {
owner = "Airblader";
repo = "i3blocks-gaps";
rev = "4cfdf93c75f729a2c96d471004d31734e923812f";
sha256 = "0v9307ij8xzwdaxay3r75sd2cp453s3qb6q7dy9fks2p6wwqpazi";
};
makeFlags = [ "all" ];
installFlags = [ "PREFIX=\${out}" "VERSION=${version}" ];
2024-08-13 21:08:38 +01:00
buildInputs = lib.optional (contains_any scripts perlscripts) perl;
nativeBuildInputs = [ makeWrapper ];
2024-08-13 21:08:38 +01:00
postFixup = lib.optionalString (lib.elem "bandwidth" scripts) ''
wrapProgram $out/libexec/i3blocks/bandwidth \
2024-08-13 21:08:38 +01:00
--prefix PATH : ${lib.makeBinPath [ iproute2 ]}
'' + lib.optionalString (lib.elem "battery" scripts) ''
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) ''
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) ''
wrapProgram $out/libexec/i3blocks/iface \
2024-08-13 21:08:38 +01:00
--prefix PATH : ${lib.makeBinPath [ iproute2 ]}
'' + lib.optionalString (lib.elem "volume" scripts) ''
wrapProgram $out/libexec/i3blocks/volume \
2024-08-13 21:08:38 +01:00
--prefix PATH : ${lib.makeBinPath [ alsa-utils ]}
'';
meta = with lib; {
description = "Flexible scheduler for your i3bar blocks -- this is a fork to use with i3-gaps";
mainProgram = "i3blocks";
homepage = "https://github.com/Airblader/i3blocks-gaps";
license = licenses.gpl3;
maintainers = with maintainers; [ carlsverre ];
2016-08-12 04:21:55 +01:00
platforms = platforms.linux;
};
}