From 82076fcde4f878e74a6a9e341526c9f796dee522 Mon Sep 17 00:00:00 2001
From: polykernel <81340136+polykernel@users.noreply.github.com>
Date: Sat, 7 Aug 2021 23:46:29 -0400
Subject: [PATCH 1/2] yambar: refactor derivation and split backends as
separate packages
* Use fetchFromGitea instead of fetchgit, submodules are unnecessary
as we wlr-protocols are vendored.
* Split into xorg and wayland backends based on an option flag, (By
default, the xorg backend is used, this might be a breaking change)
* Adhere to syntax style guide for long lists.
---
pkgs/applications/misc/yambar/default.nix | 39 +++++++++++++++++++----
pkgs/top-level/all-packages.nix | 2 ++
2 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/pkgs/applications/misc/yambar/default.nix b/pkgs/applications/misc/yambar/default.nix
index 933f352e5e86..db2f0579d1e8 100644
--- a/pkgs/applications/misc/yambar/default.nix
+++ b/pkgs/applications/misc/yambar/default.nix
@@ -1,6 +1,6 @@
{ stdenv
, lib
-, fetchgit
+, fetchFromGitea
, pkg-config
, meson
, ninja
@@ -9,50 +9,75 @@
, fcft
, json_c
, libmpdclient
-, libxcb
, libyaml
, pixman
, tllist
, udev
, wayland
+, wayland-scanner
, wayland-protocols
+, waylandSupport ? false
+# Xorg backend
+, libxcb
, xcbutil
, xcbutilcursor
, xcbutilerrors
, xcbutilwm
}:
+let
+ # Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
+ mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
+in
+
stdenv.mkDerivation rec {
pname = "yambar";
version = "1.6.2";
- src = fetchgit {
- url = "https://codeberg.org/dnkl/yambar.git";
+ src = fetchFromGitea {
+ domain = "codeberg.org";
+ owner = "dnkl";
+ repo = "yambar";
rev = version;
- sha256 = "sha256-oUNkaWrYIcsK2u+aeRg6DHmH4M1VZ0leNSM0lV9Yy1Y=";
+ sha256 = "sha256-GPKR2BYl3ebxxXbVfH/oZLs7639EYwWU4ZsilJn0Ss8=";
};
- nativeBuildInputs = [ pkg-config meson ninja scdoc ];
+ nativeBuildInputs = [
+ pkg-config
+ meson
+ ninja
+ scdoc
+ wayland-scanner
+ ];
+
buildInputs = [
alsa-lib
fcft
json_c
libmpdclient
- libxcb
libyaml
pixman
tllist
udev
wayland
wayland-protocols
+ ] ++ lib.optionals (!waylandSupport) [
xcbutil
xcbutilcursor
xcbutilerrors
xcbutilwm
];
+ mesonBuildType = "release";
+
+ mesonFlags = [
+ (mesonFeatureFlag "backend-x11" (!waylandSupport))
+ (mesonFeatureFlag "backend-wayland" waylandSupport)
+ ];
+
meta = with lib; {
homepage = "https://codeberg.org/dnkl/yambar";
+ changelog = "https://codeberg.org/dnkl/yambar/releases/tag/${version}";
description = "Modular status panel for X11 and Wayland";
longDescription = ''
yambar is a lightweight and configurable status panel (bar, for short) for
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 090a0461680e..7223cf6b20f5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -26246,6 +26246,8 @@ in
yambar = callPackage ../applications/misc/yambar { };
+ yambar-wayland = callPackage ../applications/misc/yambar { waylandSupport = true; };
+
polyphone = libsForQt514.callPackage ../applications/audio/polyphone { };
portfolio = callPackage ../applications/office/portfolio {
From bc520477f49c0a5a7ba6014a7126da05dbcb2fef Mon Sep 17 00:00:00 2001
From: polykernel <81340136+polykernel@users.noreply.github.com>
Date: Sun, 8 Aug 2021 00:01:23 -0400
Subject: [PATCH 2/2] yambar: document breaking changes
* Previously, both the xorg and wayland backend were built into the yambar
package. The refactor breaks up each backends to its separate, with xorg
being the default. Thus yambar users on wayland should switch to the
yambar-wayland package.
---
.../doc/manual/from_md/release-notes/rl-2111.section.xml | 9 +++++++++
nixos/doc/manual/release-notes/rl-2111.section.md | 2 ++
2 files changed, 11 insertions(+)
diff --git a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
index 7c58539bcafa..d5bccd21735e 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2111.section.xml
@@ -663,6 +663,15 @@
group.
+
+
+ The yambar package has been split into
+ yambar and
+ yambar-wayland, corresponding to the xorg
+ and wayland backend respectively. Please switch to
+ yambar-wayland if you are on wayland.
+
+
diff --git a/nixos/doc/manual/release-notes/rl-2111.section.md b/nixos/doc/manual/release-notes/rl-2111.section.md
index ee40b509d0e7..54347750a678 100644
--- a/nixos/doc/manual/release-notes/rl-2111.section.md
+++ b/nixos/doc/manual/release-notes/rl-2111.section.md
@@ -166,6 +166,8 @@ pt-services.clipcat.enable).
- The `openrazer` and `openrazer-daemon` packages as well as the `hardware.openrazer` module now require users to be members of the `openrazer` group instead of `plugdev`. With this change, users no longer need be granted the entire set of `plugdev` group permissions, which can include permissions other than those required by `openrazer`. This is desirable from a security point of view. The setting [`harware.openrazer.users`](options.html#opt-services.hardware.openrazer.users) can be used to add users to the `openrazer` group.
+- The `yambar` package has been split into `yambar` and `yambar-wayland`, corresponding to the xorg and wayland backend respectively. Please switch to `yambar-wayland` if you are on wayland.
+
## Other Notable Changes {#sec-release-21.11-notable-changes}
- The setting [`services.openssh.logLevel`](options.html#opt-services.openssh.logLevel) `"VERBOSE"` `"INFO"`. This brings NixOS in line with upstream and other Linux distributions, and reduces log spam on servers due to bruteforcing botnets.