19 , evdevSupport ? true, libevdev
20 , inputSupport ? true, libinput
21 , jackSupport ? true, libjack2
22 , mpdSupport ? true, libmpdclient
23 , nlSupport ? true, libnl
24 , pulseSupport ? true, libpulseaudio
25 , rfkillSupport ? true
26 , runTests ? true, catch2_3
27 , sndioSupport ? true, sndio
28 , swaySupport ? true, sway
29 , traySupport ? true, libdbusmenu-gtk3
30 , udevSupport ? true, udev
31 , upowerSupport ? true, upower
32 , withMediaPlayer ? false, glib, gobject-introspection, python3, playerctl
35 stdenv.mkDerivation rec {
39 src = fetchFromGitHub {
43 sha256 = "sha256-u2nEMS0lJ/Kf09+mWYWQLji9MVgjYAfUi5bmPEfTfFc=";
47 meson ninja pkg-config scdoc wrapGAppsHook
48 ] ++ lib.optional withMediaPlayer gobject-introspection;
50 propagatedBuildInputs = lib.optionals withMediaPlayer [
53 python3.pkgs.pygobject3
57 buildInputs = with lib;
58 [ wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon ]
59 ++ optional (!stdenv.isLinux) libinotify-kqueue
60 ++ optional evdevSupport libevdev
61 ++ optional inputSupport libinput
62 ++ optional jackSupport libjack2
63 ++ optional mpdSupport libmpdclient
64 ++ optional nlSupport libnl
65 ++ optional pulseSupport libpulseaudio
66 ++ optional sndioSupport sndio
67 ++ optional swaySupport sway
68 ++ optional traySupport libdbusmenu-gtk3
69 ++ optional udevSupport udev
70 ++ optional upowerSupport upower;
72 checkInputs = [ catch2_3 ];
75 mesonFlags = (lib.mapAttrsToList
76 (option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
78 dbusmenu-gtk = traySupport;
80 libinput = inputSupport;
82 libudev = udevSupport;
84 pulseaudio = pulseSupport;
85 rfkill = rfkillSupport;
88 upower_glib = upowerSupport;
92 "-Dgtk-layer-shell=enabled"
96 preFixup = lib.optionalString withMediaPlayer ''
97 cp $src/resources/custom_modules/mediaplayer.py $out/bin/waybar-mediaplayer.py
99 wrapProgram $out/bin/waybar-mediaplayer.py \
100 --prefix PYTHONPATH : "$PYTHONPATH:$out/${python3.sitePackages}"
104 description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
105 license = licenses.mit;
106 maintainers = with maintainers; [ FlorianFranzen minijackson synthetica lovesegfault ];
107 platforms = platforms.unix;
108 homepage = "https://github.com/alexays/waybar";