2021-02-12 11:34:53 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
2021-08-17 11:03:46 +01:00
|
|
|
, cmake
|
2021-02-12 11:34:53 +00:00
|
|
|
, pkg-config
|
|
|
|
, ninja
|
|
|
|
, wrapGAppsHook
|
|
|
|
, wayland
|
|
|
|
, wlroots
|
|
|
|
, gtkmm3
|
|
|
|
, libsigcxx
|
|
|
|
, jsoncpp
|
|
|
|
, fmt
|
|
|
|
, scdoc
|
|
|
|
, spdlog
|
|
|
|
, gtk-layer-shell
|
2021-08-17 11:03:46 +01:00
|
|
|
, howard-hinnant-date
|
|
|
|
, libxkbcommon
|
2019-01-26 15:43:16 +00:00
|
|
|
, traySupport ? true, libdbusmenu-gtk3
|
2020-09-22 20:01:20 +01: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
|
2021-08-17 11:03:46 +01:00
|
|
|
, evdevSupport ? true, libevdev
|
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 18:40:29 +01: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-08-17 11:03:46 +01:00
|
|
|
version = "0.9.8";
|
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-08-17 11:03:46 +01:00
|
|
|
sha256 = "sha256-XOguhbvlO3iUyk5gWOvimipXV8yqnia0LKoSA1wiKoE=";
|
2021-02-12 11:34:53 +00:00
|
|
|
};
|
2020-04-18 18:40:29 +01: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;
|
2021-08-17 11:03:46 +01:00
|
|
|
[ wayland wlroots gtkmm3 libsigcxx jsoncpp fmt spdlog gtk-layer-shell howard-hinnant-date libxkbcommon ]
|
2021-02-12 11:34:53 +00:00
|
|
|
++ optional traySupport libdbusmenu-gtk3
|
|
|
|
++ optional pulseSupport libpulseaudio
|
|
|
|
++ optional sndioSupport sndio
|
|
|
|
++ optional nlSupport libnl
|
|
|
|
++ optional udevSupport udev
|
2021-08-17 11:03:46 +01:00
|
|
|
++ optional evdevSupport libevdev
|
2021-02-12 11:34:53 +00:00
|
|
|
++ 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 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-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";
|
|
|
|
};
|
|
|
|
}
|