From db5ed5d7fb8eb88ba74a50b8fca9e868298b1b5d Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sat, 11 May 2024 11:59:58 +0200 Subject: [PATCH] pipewire: fix enableSystemd option Setting enableSystemd to false did not disable systemd, because on most Linux configurations, udev is an alias for systemd, so Pipewire would still find libsystemd, and link e.g. libpipewire-module-protocol-native against it. With libsystemd actually not available in the build environment, we need to set -Dsystemd=disabled, which should also avoid this unintended automatic systemd linkage in future. Additionally, since udev was always an input, there was no point also providing an eudev input. udev is an alias for a udev implementation appropriate for the platform (systemd, libudev-zero, or in future libudev-devd). eudev can still be used using an override: pipewire.override { enableSystemd = false; udev = eudev; } So with this change, setting enableSystemd to false will disable systemd-specific functionality in pipewire, but it will use systemd's udev implementation (which might as well just be a more up to date version of eudev), which matches the behaviour of other enableSystemd/systemdSupport options in Nixpkgs, and in the case where even systemd's udev implementation is for some reason too much, that's configurable as well. --- pkgs/development/libraries/pipewire/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix index 48f2dec6b89b..a4f3f80fbf3f 100644 --- a/pkgs/development/libraries/pipewire/default.nix +++ b/pkgs/development/libraries/pipewire/default.nix @@ -4,7 +4,6 @@ , python3 , meson , ninja -, eudev , systemd , enableSystemd ? true , pkg-config @@ -125,8 +124,7 @@ stdenv.mkDerivation(finalAttrs: { lilv ncurses readline - udev - ] ++ (if enableSystemd then [ systemd ] else [ eudev ]) + ] ++ (if enableSystemd then [ systemd ] else [ udev ]) ++ (if lib.meta.availableOn stdenv.hostPlatform webrtc-audio-processing_1 then [ webrtc-audio-processing_1 ] else [ webrtc-audio-processing ]) ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ] ++ lib.optionals libcameraSupport [ libcamera ] @@ -159,6 +157,7 @@ stdenv.mkDerivation(finalAttrs: { (lib.mesonEnable "libpulse" pulseTunnelSupport) (lib.mesonEnable "avahi" zeroconfSupport) (lib.mesonEnable "gstreamer" gstreamerSupport) + (lib.mesonEnable "systemd" enableSystemd) (lib.mesonEnable "systemd-system-service" enableSystemd) (lib.mesonEnable "udev" (!enableSystemd)) (lib.mesonEnable "ffmpeg" ffmpegSupport)