Skip to content

Commit

Permalink
waybar: add systemdSupport input (NixOS#345107)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRTitor authored Sep 29, 2024
2 parents b5c4f45 + 5fcc133 commit 007e916
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion nixos/modules/programs/wayland/waybar.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ in
{
options.programs.waybar = {
enable = lib.mkEnableOption "waybar, a highly customizable Wayland bar for Sway and Wlroots based compositors";
package = lib.mkPackageOption pkgs "waybar" { };
package =
lib.mkPackageOption pkgs "waybar" { }
// lib.mkOption {
apply = pkg: pkg.override { systemdSupport = true; };
};
};

config = lib.mkIf cfg.enable {
Expand Down
9 changes: 7 additions & 2 deletions pkgs/by-name/wa/waybar/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
scdoc,
sndio,
spdlog,
systemdMinimal,
sway,
udev,
upower,
Expand All @@ -60,6 +61,7 @@
rfkillSupport ? true,
runTests ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
sndioSupport ? true,
systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal,
swaySupport ? true,
traySupport ? true,
udevSupport ? true,
Expand Down Expand Up @@ -153,6 +155,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional pulseSupport libpulseaudio
++ lib.optional sndioSupport sndio
++ lib.optional swaySupport sway
++ lib.optional systemdSupport systemdMinimal
++ lib.optional traySupport libdbusmenu-gtk3
++ lib.optional udevSupport udev
++ lib.optional upowerSupport upower
Expand All @@ -179,14 +182,16 @@ stdenv.mkDerivation (finalAttrs: {
"pulseaudio" = pulseSupport;
"rfkill" = rfkillSupport;
"sndio" = sndioSupport;
"systemd" = true;
"systemd" = systemdSupport;
"tests" = runTests;
"upower_glib" = upowerSupport;
"wireplumber" = wireplumberSupport;
})
++ lib.optional experimentalPatches (lib.mesonBool "experimental" true);

PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
env = lib.optionalAttrs systemdSupport {
PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
};

postPatch = ''
substituteInPlace include/util/command.hpp \
Expand Down

0 comments on commit 007e916

Please sign in to comment.