upower: add withSystemd option

Since 7f2a6f17fc ("xdg-desktop-portal-gtk: Enable all default
portals unconditionally"), building upower is necessary to build
xdg-desktop-portal-gtk, but it wasn't possible for systems that can't
use systemd.

I've called the option "withSystemd" as it's the most common name for
this kind of option in Nixpkgs, and it's consistent with the package's
"withIntrospection" argument (though not "useIMobileDevice").
This commit is contained in:
Alyssa Ross 2024-10-10 22:41:55 +02:00
parent e7a5d9ec42
commit 9704a4f856

View File

@ -17,7 +17,6 @@
, libusb1
, glib
, gettext
, systemd
, nixosTests
, useIMobileDevice ? true
, libimobiledevice
@ -26,6 +25,8 @@
, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
, buildPackages
, gobject-introspection
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
, systemd
}:
assert withDocs -> withIntrospection;
@ -82,7 +83,6 @@ stdenv.mkDerivation (finalAttrs: {
libgudev
libusb1
udev
systemd
] ++ lib.optionals withIntrospection [
# Duplicate from nativeCheckInputs until https://github.com/NixOS/nixpkgs/issues/161570 is solved
umockdev
@ -94,6 +94,8 @@ stdenv.mkDerivation (finalAttrs: {
pp.pygobject3
pp.packaging
]))
] ++ lib.optionals withSystemd [
systemd
] ++ lib.optionals useIMobileDevice [
libimobiledevice
];