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