git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/yabar: fix module & test (#46954)

The `pkgs.yabar` package is relatively old (2016-04) and contains several issues fixed on master. `yabar-unstable` containsa recent master build with several fixes and a lot of new features (I use `yabar-unstable` for some time now and had no issues with it). In the upstream bugtracker some bugs could be fixed on ArchLinux by simply installing `yabar-git` (an AUR package which builds a recent master). To stabilize the module, the option `programs.yabar.package` now defaults to `pkgs.yabar-unstable` and yields a warning with several linked issues that are known on `pkgs.yabar`. The test has been refactored as well to ensure that `yabar` actually starts (and avoid non-deterministic random success) and takes a screenshot of a very minimalistic configuration on IceWM. Fixes #46899

commit8b58a7187c9f3c8f1997f328c27c536effccdac3 authorMaximilian Bosch <maximilian@mbosch.me> dateThu 20 Sep 2018, 12:47 (8 years ago) parentc6d0260
2 files changed+27−6
nixos/modules/programs/yabar.nix+15−2 nixos/tests/yabar.nix+12−4
nixos/modules/programs/yabar.nix+15−2
@@ -44,10 +44,23 @@ in
4444 enable = mkEnableOption "yabar";
4545
4646 package = mkOption {
47− default = pkgs.yabar;
48− example = literalExample "pkgs.yabar-unstable";
47+ default = pkgs.yabar-unstable;
48+ example = literalExample "pkgs.yabar";
4949 type = types.package;
5050
51+ # `yabar-stable` segfaults under certain conditions.
52+ apply = x: if x == pkgs.yabar-unstable then x else flip warn x ''
53+ It's not recommended to use `yabar' with `programs.yabar', the (old) stable release
54+ tends to segfault under certain circumstances:
55+
56+ * https://github.com/geommer/yabar/issues/86
57+ * https://github.com/geommer/yabar/issues/68
58+ * https://github.com/geommer/yabar/issues/143
59+
60+ Most of them don't occur on master anymore, until a new release is published, it's recommended
61+ to use `yabar-unstable'.
62+ '';
63+
5164 description = ''
5265 The package which contains the `yabar` binary.
5366
nixos/tests/yabar.nix+12−4
@@ -8,18 +8,26 @@ with lib;
88 maintainers = [ ma27 ];
99 };
1010
11− nodes.yabar = {
11+ machine = {
1212 imports = [ ./common/x11.nix ./common/user-account.nix ];
1313
1414 services.xserver.displayManager.auto.user = "bob";
1515
1616 programs.yabar.enable = true;
17+ programs.yabar.bars = {
18+ top.indicators.date.exec = "YABAR_DATE";
19+ };
1720 };
1821
1922 testScript = ''
20− $yabar->start;
21− $yabar->waitForX;
23+ $machine->start;
24+ $machine->waitForX;
2225
23− $yabar->waitForUnit("yabar.service", "bob");
26+ # confirm proper startup
27+ $machine->waitForUnit("yabar.service", "bob");
28+ $machine->sleep(10);
29+ $machine->waitForUnit("yabar.service", "bob");
30+
31+ $machine->screenshot("top_bar");
2432 '';
2533})