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

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

147 lines
4.2 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
, 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
, 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
, withMediaPlayer ? mprisSupport && false, glib, gobject-introspection, python3
2019-01-26 15:43:16 +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
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 = [
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
];
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 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
++ optional mprisSupport playerctl
2022-10-27 07:36:16 +00:00
++ 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
nativeCheckInputs = [ 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"}")
{
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;
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;
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; {
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;
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";
};
}