2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, pkg-config
|
|
|
|
, ninja
|
|
|
|
, wrapGAppsHook
|
|
|
|
, wayland
|
|
|
|
, wlroots
|
|
|
|
, gtkmm3
|
|
|
|
, libsigcxx
|
|
|
|
, jsoncpp
|
|
|
|
, scdoc
|
|
|
|
, spdlog
|
|
|
|
, gtk-layer-shell
|
2021-08-18 13:19:15 +00:00
|
|
|
, howard-hinnant-date
|
2022-10-30 15:09:59 +00:00
|
|
|
, libinotify-kqueue
|
2021-08-18 13:19:15 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, evdevSupport ? true, libevdev
|
2022-10-30 15:09:59 +00:00
|
|
|
, inputSupport ? true, libinput
|
|
|
|
, jackSupport ? true, libjack2
|
2021-08-18 13:19:15 +00:00
|
|
|
, mpdSupport ? true, libmpdclient
|
2022-10-30 15:09:59 +00:00
|
|
|
, nlSupport ? true, libnl
|
|
|
|
, pulseSupport ? true, libpulseaudio
|
2021-08-18 13:19:15 +00:00
|
|
|
, rfkillSupport ? true
|
2022-10-30 15:09:59 +00:00
|
|
|
, runTests ? true, catch2_3
|
|
|
|
, sndioSupport ? true, sndio
|
|
|
|
, swaySupport ? true, sway
|
|
|
|
, traySupport ? true, libdbusmenu-gtk3
|
|
|
|
, udevSupport ? true, udev
|
|
|
|
, upowerSupport ? true, upower
|
|
|
|
, withMediaPlayer ? false, glib, gobject-introspection, python3, playerctl
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waybar";
|
2022-10-30 15:09:59 +00:00
|
|
|
version = "0.9.14";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Alexays";
|
|
|
|
repo = "Waybar";
|
|
|
|
rev = version;
|
2022-10-30 15:09:59 +00:00
|
|
|
sha256 = "sha256-1tnFBUB7/MjnrCkfKOR2SZ/GB5Ik115zsnwjkNMB05E=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
nativeBuildInputs = [
|
2021-08-18 13:19:15 +00:00
|
|
|
meson ninja pkg-config scdoc wrapGAppsHook
|
2021-02-13 14:23:35 +00:00
|
|
|
] ++ lib.optional withMediaPlayer gobject-introspection;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
propagatedBuildInputs = lib.optionals withMediaPlayer [
|
|
|
|
glib
|
|
|
|
playerctl
|
2022-10-30 15:09:59 +00:00
|
|
|
python3.pkgs.pygobject3
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
strictDeps = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
buildInputs = with lib;
|
2021-12-06 16:07:01 +00:00
|
|
|
[ wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon ]
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional (!stdenv.isLinux) libinotify-kqueue
|
|
|
|
++ optional evdevSupport libevdev
|
|
|
|
++ optional inputSupport libinput
|
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optional mpdSupport libmpdclient
|
|
|
|
++ optional nlSupport libnl
|
2022-06-16 17:23:12 +00:00
|
|
|
++ optional pulseSupport libpulseaudio
|
|
|
|
++ optional sndioSupport sndio
|
|
|
|
++ optional swaySupport sway
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional traySupport libdbusmenu-gtk3
|
|
|
|
++ optional udevSupport udev
|
2022-06-16 17:23:12 +00:00
|
|
|
++ optional upowerSupport upower;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
checkInputs = [ catch2_3 ];
|
2022-01-19 23:45:15 +00:00
|
|
|
doCheck = runTests;
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
mesonFlags = (lib.mapAttrsToList
|
|
|
|
(option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
|
|
|
|
{
|
|
|
|
dbusmenu-gtk = traySupport;
|
2022-10-30 15:09:59 +00:00
|
|
|
jack = jackSupport;
|
|
|
|
libinput = inputSupport;
|
2021-02-13 14:23:35 +00:00
|
|
|
libnl = nlSupport;
|
|
|
|
libudev = udevSupport;
|
|
|
|
mpd = mpdSupport;
|
2022-10-30 15:09:59 +00:00
|
|
|
pulseaudio = pulseSupport;
|
2021-08-18 13:19:15 +00:00
|
|
|
rfkill = rfkillSupport;
|
2022-10-30 15:09:59 +00:00
|
|
|
sndio = sndioSupport;
|
2022-01-19 23:45:15 +00:00
|
|
|
tests = runTests;
|
2022-10-30 15:09:59 +00:00
|
|
|
upower_glib = upowerSupport;
|
2021-02-13 14:23:35 +00:00
|
|
|
}
|
|
|
|
) ++ [
|
|
|
|
"-Dsystemd=disabled"
|
2021-08-18 13:19:15 +00:00
|
|
|
"-Dgtk-layer-shell=enabled"
|
|
|
|
"-Dman-pages=enabled"
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
preFixup = lib.optionalString withMediaPlayer ''
|
2020-05-29 06:06:01 +00:00
|
|
|
cp $src/resources/custom_modules/mediaplayer.py $out/bin/waybar-mediaplayer.py
|
|
|
|
|
|
|
|
wrapProgram $out/bin/waybar-mediaplayer.py \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH:$out/${python3.sitePackages}"
|
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
|
|
|
|
license = licenses.mit;
|
2021-03-09 03:18:52 +00:00
|
|
|
maintainers = with maintainers; [ FlorianFranzen minijackson synthetica lovesegfault ];
|
2021-02-13 14:23:35 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
homepage = "https://github.com/alexays/waybar";
|
|
|
|
};
|
|
|
|
}
|