3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/waybar/default.nix

96 lines
2.5 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
, fmt
, scdoc
, spdlog
, gtk-layer-shell
2021-08-17 11:03:46 +01:00
, howard-hinnant-date
, libxkbcommon
2021-08-18 02:17:36 +01:00
, traySupport ? true, libdbusmenu-gtk3
, pulseSupport ? true, libpulseaudio
, sndioSupport ? true, sndio
, nlSupport ? true, libnl
, udevSupport ? true, udev
, evdevSupport ? true, libevdev
, swaySupport ? true, sway
, mpdSupport ? true, libmpdclient
, rfkillSupport ? true
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
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
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;
2021-08-18 02:17:36 +01:00
rfkill = rfkillSupport;
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 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";
};
}