diff --git a/nixos/modules/programs/wayland/waybar.nix b/nixos/modules/programs/wayland/waybar.nix index 35c5cc86f3b4d..074537ea9ed3b 100644 --- a/nixos/modules/programs/wayland/waybar.nix +++ b/nixos/modules/programs/wayland/waybar.nix @@ -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 { diff --git a/pkgs/by-name/wa/waybar/package.nix b/pkgs/by-name/wa/waybar/package.nix index e0eb7a76eda05..2c2cc2c2535f5 100644 --- a/pkgs/by-name/wa/waybar/package.nix +++ b/pkgs/by-name/wa/waybar/package.nix @@ -37,6 +37,7 @@ scdoc, sndio, spdlog, + systemdMinimal, sway, udev, upower, @@ -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, @@ -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 @@ -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 \