2021-01-17 02:09:27 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, meson, pkg-config, ninja, wrapGAppsHook
|
2020-08-06 07:23:18 +01:00
|
|
|
, wayland, wlroots, gtkmm3, libsigcxx, jsoncpp, fmt, scdoc, spdlog, gtk-layer-shell
|
2020-02-18 08:41:40 +00:00
|
|
|
, howard-hinnant-date, cmake
|
2019-01-26 15:43:16 +00:00
|
|
|
, traySupport ? true, libdbusmenu-gtk3
|
2020-09-22 20:01:20 +01:00
|
|
|
, pulseSupport ? true, libpulseaudio
|
2019-01-26 15:43:16 +00:00
|
|
|
, nlSupport ? true, libnl
|
2019-03-26 15:37:24 +00:00
|
|
|
, udevSupport ? true, udev
|
2019-01-26 15:43:16 +00:00
|
|
|
, swaySupport ? true, sway
|
2019-05-01 10:25:30 +01:00
|
|
|
, mpdSupport ? true, mpd_clientlib
|
2020-04-18 18:40:29 +01:00
|
|
|
, withMediaPlayer ? false, glib, gobject-introspection, python3, python38Packages, playerctl
|
2019-01-26 15:43:16 +00:00
|
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
2019-06-10 13:35:06 +01:00
|
|
|
pname = "waybar";
|
2020-09-25 22:00:30 +01:00
|
|
|
version = "0.9.4";
|
2019-01-26 15:43:16 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Alexays";
|
|
|
|
repo = "Waybar";
|
|
|
|
rev = version;
|
2020-09-25 22:00:30 +01:00
|
|
|
sha256 = "038vnma7y7z81caywp45yr364bc1aq8d01j5vycyiyfv33nm76fy";
|
2019-01-26 15:43:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 02:09:27 +00:00
|
|
|
meson ninja pkg-config scdoc wrapGAppsHook cmake
|
2021-01-15 05:42:41 +00:00
|
|
|
] ++ lib.optional withMediaPlayer gobject-introspection;
|
2020-04-18 18:40:29 +01:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
propagatedBuildInputs = lib.optionals withMediaPlayer [
|
2020-04-18 18:40:29 +01:00
|
|
|
glib
|
|
|
|
playerctl
|
|
|
|
python38Packages.pygobject3
|
2019-01-26 15:43:16 +00:00
|
|
|
];
|
2020-04-18 18:40:29 +01:00
|
|
|
strictDeps = false;
|
2019-01-26 15:43:16 +00:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
buildInputs = with lib;
|
2020-08-06 07:23:18 +01:00
|
|
|
[ wayland wlroots gtkmm3 libsigcxx jsoncpp fmt spdlog gtk-layer-shell howard-hinnant-date ]
|
2019-01-26 15:43:16 +00:00
|
|
|
++ optional traySupport libdbusmenu-gtk3
|
|
|
|
++ optional pulseSupport libpulseaudio
|
|
|
|
++ optional nlSupport libnl
|
2019-03-26 15:37:24 +00:00
|
|
|
++ optional udevSupport udev
|
2019-05-01 10:25:30 +01:00
|
|
|
++ optional swaySupport sway
|
|
|
|
++ optional mpdSupport mpd_clientlib;
|
2019-01-26 15:43:16 +00:00
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
mesonFlags = (lib.mapAttrsToList
|
2019-06-04 20:15:29 +01:00
|
|
|
(option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
|
|
|
|
{
|
|
|
|
dbusmenu-gtk = traySupport;
|
|
|
|
pulseaudio = pulseSupport;
|
|
|
|
libnl = nlSupport;
|
|
|
|
libudev = udevSupport;
|
|
|
|
mpd = mpdSupport;
|
|
|
|
}
|
|
|
|
) ++ [
|
2019-01-26 15:43:16 +00:00
|
|
|
"-Dout=${placeholder "out"}"
|
2019-12-28 15:09:15 +00:00
|
|
|
"-Dsystemd=disabled"
|
2019-01-26 15:43:16 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 05:42:41 +00:00
|
|
|
preFixup = lib.optional withMediaPlayer ''
|
2020-04-18 18:40:29 +01: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-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-01-26 15:43:16 +00:00
|
|
|
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
|
|
|
|
license = licenses.mit;
|
2019-06-10 13:36:22 +01:00
|
|
|
maintainers = with maintainers; [ FlorianFranzen minijackson synthetica ];
|
2019-01-26 15:43:16 +00:00
|
|
|
platforms = platforms.unix;
|
2020-02-18 08:41:40 +00:00
|
|
|
homepage = "https://github.com/alexays/waybar";
|
2019-01-26 15:43:16 +00:00
|
|
|
};
|
|
|
|
}
|