2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, pkg-config
|
|
|
|
, ninja
|
|
|
|
, wrapGAppsHook
|
|
|
|
, wayland
|
|
|
|
, wlroots
|
|
|
|
, gtkmm3
|
|
|
|
, libsigcxx
|
|
|
|
, jsoncpp
|
|
|
|
, scdoc
|
|
|
|
, spdlog
|
|
|
|
, gtk-layer-shell
|
2021-08-18 13:19:15 +00:00
|
|
|
, howard-hinnant-date
|
2022-10-30 15:09:59 +00:00
|
|
|
, libinotify-kqueue
|
2021-08-18 13:19:15 +00:00
|
|
|
, libxkbcommon
|
2023-07-15 17:15:38 +00:00
|
|
|
, cavaSupport ? true, alsa-lib, fftw, iniparser, ncurses, pipewire, portaudio, SDL2
|
2021-08-18 13:19:15 +00:00
|
|
|
, evdevSupport ? true, libevdev
|
2022-10-30 15:09:59 +00:00
|
|
|
, inputSupport ? true, libinput
|
|
|
|
, jackSupport ? true, libjack2
|
2021-08-18 13:19:15 +00:00
|
|
|
, mpdSupport ? true, libmpdclient
|
2023-01-20 10:41:00 +00:00
|
|
|
, mprisSupport ? stdenv.isLinux, playerctl ? false
|
2022-10-30 15:09:59 +00:00
|
|
|
, nlSupport ? true, libnl
|
|
|
|
, pulseSupport ? true, libpulseaudio
|
2021-08-18 13:19:15 +00:00
|
|
|
, rfkillSupport ? true
|
2022-10-30 15:09:59 +00:00
|
|
|
, runTests ? true, catch2_3
|
|
|
|
, sndioSupport ? true, sndio
|
|
|
|
, swaySupport ? true, sway
|
|
|
|
, traySupport ? true, libdbusmenu-gtk3
|
|
|
|
, udevSupport ? true, udev
|
|
|
|
, upowerSupport ? true, upower
|
2022-11-27 09:42:12 +00:00
|
|
|
, wireplumberSupport ? true, wireplumber
|
2023-01-20 10:41:00 +00:00
|
|
|
, withMediaPlayer ? mprisSupport && false, glib, gobject-introspection, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
2023-07-15 17:15:38 +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-13 14:23:35 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waybar";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.9.20";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Alexays";
|
|
|
|
repo = "Waybar";
|
|
|
|
rev = version;
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-xLcoysnCPB9+jI5cZokWWIvXM5wo3eXOe/hXfuChBR4=";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
2020-05-29 06:06:01 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postUnpack = lib.optional cavaSupport ''
|
|
|
|
(
|
|
|
|
cd "$sourceRoot"
|
|
|
|
cp -R --no-preserve=mode,ownership ${libcava.src} subprojects/cava-0.8.4
|
|
|
|
patchShebangs .
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
nativeBuildInputs = [
|
2021-08-18 13:19:15 +00:00
|
|
|
meson ninja pkg-config scdoc wrapGAppsHook
|
2021-02-13 14:23:35 +00:00
|
|
|
] ++ lib.optional withMediaPlayer gobject-introspection;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
propagatedBuildInputs = lib.optionals withMediaPlayer [
|
|
|
|
glib
|
|
|
|
playerctl
|
2022-10-30 15:09:59 +00:00
|
|
|
python3.pkgs.pygobject3
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
2023-01-20 10:41:00 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
strictDeps = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
buildInputs = with lib;
|
2021-12-06 16:07:01 +00:00
|
|
|
[ wayland wlroots gtkmm3 libsigcxx jsoncpp spdlog gtk-layer-shell howard-hinnant-date libxkbcommon ]
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional (!stdenv.isLinux) libinotify-kqueue
|
2023-07-15 17:15:38 +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-30 15:09:59 +00:00
|
|
|
++ optional evdevSupport libevdev
|
|
|
|
++ optional inputSupport libinput
|
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optional mpdSupport libmpdclient
|
2023-01-20 10:41:00 +00:00
|
|
|
++ optional mprisSupport playerctl
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional nlSupport libnl
|
2022-06-16 17:23:12 +00:00
|
|
|
++ optional pulseSupport libpulseaudio
|
|
|
|
++ optional sndioSupport sndio
|
|
|
|
++ optional swaySupport sway
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional traySupport libdbusmenu-gtk3
|
|
|
|
++ optional udevSupport udev
|
2022-11-27 09:42:12 +00:00
|
|
|
++ optional upowerSupport upower
|
|
|
|
++ optional wireplumberSupport wireplumber;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ catch2_3 ];
|
2022-01-19 23:45:15 +00:00
|
|
|
doCheck = runTests;
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
mesonFlags = (lib.mapAttrsToList
|
|
|
|
(option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
|
|
|
|
{
|
2023-07-15 17:15:38 +00:00
|
|
|
cava = cavaSupport;
|
2021-02-13 14:23:35 +00:00
|
|
|
dbusmenu-gtk = traySupport;
|
2022-10-30 15:09:59 +00:00
|
|
|
jack = jackSupport;
|
|
|
|
libinput = inputSupport;
|
2021-02-13 14:23:35 +00:00
|
|
|
libnl = nlSupport;
|
|
|
|
libudev = udevSupport;
|
|
|
|
mpd = mpdSupport;
|
2023-01-20 10:41:00 +00:00
|
|
|
mpris = mprisSupport;
|
2022-10-30 15:09:59 +00:00
|
|
|
pulseaudio = pulseSupport;
|
2021-08-18 13:19:15 +00:00
|
|
|
rfkill = rfkillSupport;
|
2022-10-30 15:09:59 +00:00
|
|
|
sndio = sndioSupport;
|
2022-01-19 23:45:15 +00:00
|
|
|
tests = runTests;
|
2022-10-30 15:09:59 +00:00
|
|
|
upower_glib = upowerSupport;
|
2022-11-27 09:42:12 +00:00
|
|
|
wireplumber = wireplumberSupport;
|
2021-02-13 14:23:35 +00:00
|
|
|
}
|
|
|
|
) ++ [
|
|
|
|
"-Dsystemd=disabled"
|
2021-08-18 13:19:15 +00:00
|
|
|
"-Dgtk-layer-shell=enabled"
|
|
|
|
"-Dman-pages=enabled"
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
preFixup = lib.optionalString withMediaPlayer ''
|
2020-05-29 06:06:01 +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-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
2023-01-20 10:41:00 +00:00
|
|
|
changelog = "https://github.com/alexays/waybar/releases/tag/${version}";
|
2021-02-13 14:23:35 +00:00
|
|
|
description = "Highly customizable Wayland bar for Sway and Wlroots based compositors";
|
|
|
|
license = licenses.mit;
|
2023-01-20 10:41:00 +00:00
|
|
|
maintainers = with maintainers; [ FlorianFranzen minijackson synthetica lovesegfault rodrgz ];
|
2021-02-13 14:23:35 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
homepage = "https://github.com/alexays/waybar";
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "waybar";
|
2021-02-13 14:23:35 +00:00
|
|
|
};
|
|
|
|
}
|