polybar: format

This commit is contained in:
Sandro Jäckel 2021-07-13 21:16:20 +02:00
parent 2913fceb38
commit 05447d62f9
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -30,87 +30,87 @@
, i3-gaps , i3-gaps
, jsoncpp , jsoncpp
# override the variables ending in 'Support' to enable or disable modules # override the variables ending in 'Support' to enable or disable modules
, alsaSupport ? true , alsaSupport ? true
, githubSupport ? false , githubSupport ? false
, mpdSupport ? false , mpdSupport ? false
, pulseSupport ? config.pulseaudio or false , pulseSupport ? config.pulseaudio or false
, iwSupport ? false , iwSupport ? false
, nlSupport ? true , nlSupport ? true
, i3Support ? false , i3Support ? false
, i3GapsSupport ? false , i3GapsSupport ? false
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "polybar"; pname = "polybar";
version = "3.5.6"; version = "3.5.6";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = pname; owner = pname;
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "sha256-Uvj9V2M/uQxyziTx1hecrcaQZECijlpVmWcUeT+PqrI="; sha256 = "sha256-Uvj9V2M/uQxyziTx1hecrcaQZECijlpVmWcUeT+PqrI=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config
python3Packages.sphinx python3Packages.sphinx
removeReferencesTo removeReferencesTo
] ] ++ lib.optional (i3Support || i3GapsSupport) makeWrapper;
++ lib.optional (i3Support || i3GapsSupport) makeWrapper;
buildInputs = [ buildInputs = [
cairo cairo
libXdmcp libXdmcp
libpthreadstubs libpthreadstubs
libxcb libxcb
pcre pcre
python3 python3
xcbproto xcbproto
xcbutil xcbutil
xcbutilcursor xcbutilcursor
xcbutilimage xcbutilimage
xcbutilrenderutil xcbutilrenderutil
xcbutilwm xcbutilwm
xcbutilxrm xcbutilxrm
] ] ++ lib.optional alsaSupport alsa-lib
++ lib.optional alsaSupport alsa-lib ++ lib.optional githubSupport curl
++ lib.optional githubSupport curl ++ lib.optional mpdSupport libmpdclient
++ lib.optional mpdSupport libmpdclient ++ lib.optional pulseSupport libpulseaudio
++ lib.optional pulseSupport libpulseaudio ++ lib.optional iwSupport wirelesstools
++ lib.optional iwSupport wirelesstools ++ lib.optional nlSupport libnl
++ lib.optional nlSupport libnl ++ lib.optional (i3Support || i3GapsSupport) jsoncpp
++ lib.optional (i3Support || i3GapsSupport) jsoncpp ++ lib.optional i3Support i3
++ lib.optional i3Support i3 ++ lib.optional i3GapsSupport i3-gaps;
++ lib.optional i3GapsSupport i3-gaps;
postInstall = if i3Support postInstall =
then ''wrapProgram $out/bin/polybar \ if i3Support then ''
--prefix PATH : "${i3}/bin" wrapProgram $out/bin/polybar \
'' --prefix PATH : "${i3}/bin"
else if i3GapsSupport ''
then ''wrapProgram $out/bin/polybar \ else if i3GapsSupport
--prefix PATH : "${i3-gaps}/bin" then ''
'' wrapProgram $out/bin/polybar \
else ''''; --prefix PATH : "${i3-gaps}/bin"
''
else "";
postFixup = '' postFixup = ''
remove-references-to -t ${stdenv.cc} $out/bin/polybar remove-references-to -t ${stdenv.cc} $out/bin/polybar
'';
meta = with lib; {
homepage = "https://polybar.github.io/";
changelog = "https://github.com/polybar/polybar/releases/tag/${version}";
description = "A fast and easy-to-use tool for creating status bars";
longDescription = ''
Polybar aims to help users build beautiful and highly customizable
status bars for their desktop environment, without the need of
having a black belt in shell scripting.
''; '';
license = licenses.mit;
meta = with lib; { maintainers = with maintainers; [ afldcr Br1ght0ne fortuneteller2k ];
homepage = "https://polybar.github.io/"; platforms = platforms.linux;
changelog = "https://github.com/polybar/polybar/releases/tag/${version}"; };
description = "A fast and easy-to-use tool for creating status bars";
longDescription = ''
Polybar aims to help users build beautiful and highly customizable
status bars for their desktop environment, without the need of
having a black belt in shell scripting.
'';
license = licenses.mit;
maintainers = with maintainers; [ afldcr Br1ght0ne fortuneteller2k ];
platforms = platforms.linux;
};
} }