waybar: DRY refactor

This commit is contained in:
Patrick Hilhorst 2019-06-04 21:15:29 +02:00
parent 8cc768b64d
commit 9d127b78f6
No known key found for this signature in database
GPG key ID: 589BB0A8DAFEF2B2

View file

@ -31,12 +31,16 @@
++ optional swaySupport sway
++ optional mpdSupport mpd_clientlib;
mesonFlags = [
"-Ddbusmenu-gtk=${ if traySupport then "enabled" else "disabled" }"
"-Dpulseaudio=${ if pulseSupport then "enabled" else "disabled" }"
"-Dlibnl=${ if nlSupport then "enabled" else "disabled" }"
"-Dlibudev=${ if udevSupport then "enabled" else "disabled" }"
"-Dmpd=${ if mpdSupport then "enabled" else "disabled" }"
mesonFlags = (stdenv.lib.mapAttrsToList
(option: enable: "-D${option}=${if enable then "enabled" else "disabled"}")
{
dbusmenu-gtk = traySupport;
pulseaudio = pulseSupport;
libnl = nlSupport;
libudev = udevSupport;
mpd = mpdSupport;
}
) ++ [
"-Dout=${placeholder "out"}"
];