From 9704a4f856b02400d9db1feb82ab4cdd122259fe Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 10 Oct 2024 22:41:55 +0200 Subject: [PATCH] upower: add withSystemd option Since 7f2a6f17fccf ("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"). --- pkgs/os-specific/linux/upower/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/linux/upower/default.nix b/pkgs/os-specific/linux/upower/default.nix index 59f88981ab90..5b4e4ede7b56 100644 --- a/pkgs/os-specific/linux/upower/default.nix +++ b/pkgs/os-specific/linux/upower/default.nix @@ -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 ];