2021-07-14 22:03:04 +00:00
|
|
|
{ config
|
|
|
|
, cairo
|
2021-02-13 14:23:35 +00:00
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
2022-04-27 09:35:20 +00:00
|
|
|
, libuv
|
2021-02-13 14:23:35 +00:00
|
|
|
, libXdmcp
|
|
|
|
, libpthreadstubs
|
|
|
|
, libxcb
|
|
|
|
, pcre
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2021-04-25 03:57:28 +00:00
|
|
|
, python3Packages # sphinx-build
|
2021-02-13 14:23:35 +00:00
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, xcbproto
|
|
|
|
, xcbutil
|
|
|
|
, xcbutilcursor
|
|
|
|
, xcbutilimage
|
|
|
|
, xcbutilrenderutil
|
|
|
|
, xcbutilwm
|
|
|
|
, xcbutilxrm
|
|
|
|
, makeWrapper
|
2020-06-18 07:06:33 +00:00
|
|
|
, removeReferencesTo
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2021-04-25 03:57:28 +00:00
|
|
|
, curl
|
|
|
|
, libmpdclient
|
|
|
|
, libpulseaudio
|
|
|
|
, wirelesstools
|
|
|
|
, libnl
|
|
|
|
, i3
|
|
|
|
, jsoncpp
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
# override the variables ending in 'Support' to enable or disable modules
|
|
|
|
, alsaSupport ? true
|
2021-04-25 03:57:28 +00:00
|
|
|
, githubSupport ? false
|
2021-07-14 22:03:04 +00:00
|
|
|
, mpdSupport ? false
|
|
|
|
, pulseSupport ? config.pulseaudio or false
|
|
|
|
, iwSupport ? false
|
|
|
|
, nlSupport ? true
|
|
|
|
, i3Support ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-07-14 22:03:04 +00:00
|
|
|
pname = "polybar";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "3.6.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-05-18 14:49:53 +00:00
|
|
|
hash = "sha256-FKkPSAEMzptnjJq3xTk+fpD8XjASQ3smX5imstDyLNE=";
|
2021-07-14 22:03:04 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
python3Packages.sphinx
|
|
|
|
removeReferencesTo
|
2023-01-11 07:51:40 +00:00
|
|
|
] ++ lib.optional i3Support makeWrapper;
|
2021-04-25 03:57:28 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
buildInputs = [
|
|
|
|
cairo
|
2022-04-27 09:35:20 +00:00
|
|
|
libuv
|
2021-07-14 22:03:04 +00:00
|
|
|
libXdmcp
|
|
|
|
libpthreadstubs
|
|
|
|
libxcb
|
|
|
|
pcre
|
|
|
|
python3
|
|
|
|
xcbproto
|
|
|
|
xcbutil
|
|
|
|
xcbutilcursor
|
|
|
|
xcbutilimage
|
|
|
|
xcbutilrenderutil
|
|
|
|
xcbutilwm
|
|
|
|
xcbutilxrm
|
|
|
|
] ++ lib.optional alsaSupport alsa-lib
|
|
|
|
++ lib.optional githubSupport curl
|
|
|
|
++ lib.optional mpdSupport libmpdclient
|
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
|
|
|
++ lib.optional iwSupport wirelesstools
|
|
|
|
++ lib.optional nlSupport libnl
|
2023-01-11 07:51:40 +00:00
|
|
|
++ lib.optionals i3Support [ jsoncpp i3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
patches = [ ./remove-hardcoded-etc.diff ];
|
|
|
|
|
|
|
|
# Replace hardcoded /etc when copying and reading the default config.
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt --replace "/etc" $out
|
|
|
|
substituteAllInPlace src/utils/file.cpp
|
|
|
|
'';
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postInstall =
|
2023-01-11 07:51:40 +00:00
|
|
|
lib.optionalString i3Support ''
|
2021-07-14 22:03:04 +00:00
|
|
|
wrapProgram $out/bin/polybar \
|
|
|
|
--prefix PATH : "${i3}/bin"
|
2023-01-11 07:51:40 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
postFixup = ''
|
|
|
|
remove-references-to -t ${stdenv.cc} $out/bin/polybar
|
|
|
|
'';
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
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;
|
2022-05-18 14:49:53 +00:00
|
|
|
maintainers = with maintainers; [ afldcr Br1ght0ne fortuneteller2k ckie ];
|
2021-07-14 22:03:04 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|