nixpkgs/pkgs/applications/misc/waybar/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

114 lines
3.1 KiB
Nix
Raw Normal View History

2021-02-12 11:34:53 +00:00
{ lib
, stdenv
, fetchFromGitHub
, meson
, pkg-config
, ninja
, wrapGAppsHook
, wayland
, wlroots
, gtkmm3
, libsigcxx
, jsoncpp
, scdoc
, spdlog
, gtk-layer-shell
2021-08-17 10:03:46 +00:00
, howard-hinnant-date
2022-10-27 07:36:16 +00:00
, libinotify-kqueue
2021-08-17 10:03:46 +00:00
, libxkbcommon
2021-08-18 01:17:36 +00:00
, evdevSupport ? true, libevdev
2022-10-27 07:36:16 +00:00
, inputSupport ? true, libinput
, jackSupport ? true, libjack2
2021-08-18 01:17:36 +00:00
, mpdSupport ? true, libmpdclient
2022-10-27 07:36:16 +00:00
, nlSupport ? true, libnl
, pulseSupport ? true, libpulseaudio
2021-08-18 01:17:36 +00:00
, rfkillSupport ? true
2022-10-27 07:36:16 +00:00
, runTests ? true, catch2_3
, sndioSupport ? true, sndio
, swaySupport ? true, sway
, traySupport ? true, libdbusmenu-gtk3
, udevSupport ? true, udev
, upowerSupport ? true, upower
2022-11-24 21:18:00 +00:00
, wireplumberSupport ? true, wireplumber
, withMediaPlayer ? false, glib, gobject-introspection, python3, playerctl
2019-01-26 15:43:16 +00:00
}:
2021-02-12 11:34:53 +00:00
stdenv.mkDerivation rec {
pname = "waybar";
2022-11-24 21:18:00 +00:00
version = "0.9.16";
2019-01-26 15:43:16 +00:00
2021-02-12 11:34:53 +00:00
src = fetchFromGitHub {
owner = "Alexays";
repo = "Waybar";
rev = version;
2022-11-24 21:18:00 +00:00
sha256 = "sha256-hcU0ijWIN7TtIPkURVmAh0kanQWkBUa22nubj7rSfBs=";
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
2021-02-12 11:34:53 +00:00
] ++ 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
python3.pkgs.pygobject3
2021-02-12 11:34:53 +00:00
];
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 spdlog gtk-layer-shell howard-hinnant-date libxkbcommon ]
2022-10-27 07:36:16 +00:00
++ optional (!stdenv.isLinux) libinotify-kqueue
++ optional evdevSupport libevdev
++ optional inputSupport libinput
++ optional jackSupport libjack2
++ optional mpdSupport libmpdclient
++ optional nlSupport libnl
++ optional pulseSupport libpulseaudio
++ optional sndioSupport sndio
++ optional swaySupport sway
2022-10-27 07:36:16 +00:00
++ optional traySupport libdbusmenu-gtk3
++ optional udevSupport udev
2022-11-24 21:18:00 +00:00
++ optional upowerSupport upower
++ optional wireplumberSupport wireplumber;
2019-01-26 15:43:16 +00:00
2022-10-27 07:36:16 +00:00
checkInputs = [ catch2_3 ];
doCheck = runTests;
2021-02-12 11:34:53 +00:00
mesonFlags = (lib.mapAttrsToList
(option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
{
dbusmenu-gtk = traySupport;
2022-10-27 07:36:16 +00:00
jack = jackSupport;
libinput = inputSupport;
2021-02-12 11:34:53 +00:00
libnl = nlSupport;
libudev = udevSupport;
mpd = mpdSupport;
2022-10-27 07:36:16 +00:00
pulseaudio = pulseSupport;
2021-08-18 01:17:36 +00:00
rfkill = rfkillSupport;
2022-10-27 07:36:16 +00:00
sndio = sndioSupport;
tests = runTests;
2022-10-27 07:36:16 +00:00
upower_glib = upowerSupport;
2022-11-24 21:18:00 +00:00
wireplumber = wireplumberSupport;
2021-02-12 11:34:53 +00:00
}
) ++ [
"-Dsystemd=disabled"
"-Dgtk-layer-shell=enabled"
"-Dman-pages=enabled"
2021-02-12 11:34:53 +00:00
];
preFixup = lib.optionalString 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";
};
}