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
|
2023-05-29 14:59:39 +00:00
|
|
|
, cavaSupport ? true, alsa-lib, fftw, iniparser, ncurses, pipewire, portaudio, SDL2
|
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
|
2023-01-13 23:31:15 +00:00
|
|
|
, mprisSupport ? stdenv.isLinux, playerctl ? false
|
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
|
2023-01-13 23:31:15 +00:00
|
|
|
, withMediaPlayer ? mprisSupport && false, glib, gobject-introspection, python3
|
2019-01-26 15:43:16 +00:00
|
|
|
}:
|
2023-05-29 14:59:39 +00:00
|
|
|
let
|
|
|
|
# Derived from subprojects/cava.wrap
|
|
|
|
libcava = rec {
|
|
|
|
version = "0.8.4";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "LukashonakV";
|
|
|
|
repo = "cava";
|
|
|
|
rev = version;
|
|
|
|
hash = "sha256-66uc0CEriV9XOjSjFTt+bxghEXY1OGrpjd+7d6piJUI=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
2021-02-12 11:34:53 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waybar";
|
2023-07-19 12:49:47 +00:00
|
|
|
version = "0.9.20";
|
2019-01-26 15:43:16 +00:00
|
|
|
|
2021-02-12 11:34:53 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Alexays";
|
|
|
|
repo = "Waybar";
|
|
|
|
rev = version;
|
2023-07-19 12:49:47 +00:00
|
|
|
hash = "sha256-xLcoysnCPB9+jI5cZokWWIvXM5wo3eXOe/hXfuChBR4=";
|
2021-02-12 11:34:53 +00:00
|
|
|
};
|
2020-04-18 17:40:29 +00:00
|
|
|
|
2023-05-29 14:59:39 +00:00
|
|
|
postUnpack = lib.optional cavaSupport ''
|
|
|
|
(
|
|
|
|
cd "$sourceRoot"
|
|
|
|
cp -R --no-preserve=mode,ownership ${libcava.src} subprojects/cava-0.8.4
|
|
|
|
patchShebangs .
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2021-02-12 11:34:53 +00:00
|
|
|
nativeBuildInputs = [
|
2021-08-18 01:16:49 +00:00
|
|
|
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
|
2022-10-23 22:17:19 +00:00
|
|
|
python3.pkgs.pygobject3
|
2021-02-12 11:34:53 +00:00
|
|
|
];
|
2023-01-13 23:31:15 +00:00
|
|
|
|
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;
|
2021-11-07 19:59:57 +00:00
|
|
|
[ 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
|
2023-05-29 14:59:39 +00:00
|
|
|
++ optional cavaSupport alsa-lib
|
|
|
|
++ optional cavaSupport iniparser
|
|
|
|
++ optional cavaSupport fftw
|
|
|
|
++ optional cavaSupport ncurses
|
|
|
|
++ optional cavaSupport pipewire
|
|
|
|
++ optional cavaSupport portaudio
|
|
|
|
++ optional cavaSupport SDL2
|
2022-10-27 07:36:16 +00:00
|
|
|
++ optional evdevSupport libevdev
|
|
|
|
++ optional inputSupport libinput
|
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optional mpdSupport libmpdclient
|
2023-01-13 23:31:15 +00:00
|
|
|
++ optional mprisSupport playerctl
|
2022-10-27 07:36:16 +00:00
|
|
|
++ optional nlSupport libnl
|
2022-05-23 18:09:25 +00:00
|
|
|
++ 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
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [ catch2_3 ];
|
2022-01-16 18:25:34 +00:00
|
|
|
doCheck = runTests;
|
|
|
|
|
2021-02-12 11:34:53 +00:00
|
|
|
mesonFlags = (lib.mapAttrsToList
|
|
|
|
(option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
|
|
|
|
{
|
2023-05-29 14:59:39 +00:00
|
|
|
cava = cavaSupport;
|
2021-02-12 11:34:53 +00:00
|
|
|
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;
|
2023-01-13 23:31:15 +00:00
|
|
|
mpris = mprisSupport;
|
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;
|
2022-01-16 18:25:34 +00:00
|
|
|
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"
|
2021-08-18 01:17:24 +00:00
|
|
|
"-Dgtk-layer-shell=enabled"
|
|
|
|
"-Dman-pages=enabled"
|
2021-02-12 11:34:53 +00:00
|
|
|
];
|
|
|
|
|
2021-08-18 00:14:20 +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; {
|
2023-01-13 23:31:15 +00:00
|
|
|
changelog = "https://github.com/alexays/waybar/releases/tag/${version}";
|
2021-02-12 11:34:53 +00:00
|
|
|
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
|
|
|
|
license = licenses.mit;
|
2023-01-13 23:31:15 +00:00
|
|
|
maintainers = with maintainers; [ FlorianFranzen minijackson synthetica lovesegfault rodrgz ];
|
2021-02-12 11:34:53 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
homepage = "https://github.com/alexays/waybar";
|
|
|
|
};
|
|
|
|
}
|