diff --git a/pkgs/applications/misc/solaar/default.nix b/pkgs/applications/misc/solaar/default.nix index f92fe87b948..bb1573f74c5 100644 --- a/pkgs/applications/misc/solaar/default.nix +++ b/pkgs/applications/misc/solaar/default.nix @@ -1,46 +1,59 @@ { fetchFromGitHub, lib, gobject-introspection, gtk3, python3Packages }: -# Although we copy in the udev rules here, you probably just want to use logitech-udev-rules instead of -# adding this to services.udev.packages on NixOS + +# Although we copy in the udev rules here, you probably just want to use +# logitech-udev-rules instead of adding this to services.udev.packages on NixOS python3Packages.buildPythonApplication rec { pname = "solaar"; - version = "1.0.2"; + version = "1.0.5"; + src = fetchFromGitHub { owner = "pwr-Solaar"; repo = "Solaar"; rev = version; - sha256 = "0k5z9dap6rawiafkg1x7zjx51ala7wra6j6lvc2nn0y8r79yp7a9"; + sha256 = "sha256-k87DqIkvy5CVEsHT82ZArSM2JBi5sYdSCPfP4KjI850="; }; - propagatedBuildInputs = with python3Packages; [ gobject-introspection gtk3 pygobject3 pyudev ]; + propagatedBuildInputs = with python3Packages; [ + gobject-introspection + gtk3 + psutil + pygobject3 + pyudev + pyyaml + xlib + ]; + makeWrapperArgs = [ + "--prefix PYTHONPATH : $PYTHONPATH" + "--prefix GI_TYPELIB_PATH : $GI_TYPELIB_PATH" + ]; + + # the -cli symlink is just to maintain compabilility with older versions where + # there was a difference between the GUI and CLI versions. postInstall = '' - wrapProgram "$out/bin/solaar" \ - --prefix PYTHONPATH : "$PYTHONPATH" \ - --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" - wrapProgram "$out/bin/solaar-cli" \ - --prefix PYTHONPATH : "$PYTHONPATH" \ - --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" + ln -s $out/bin/solaar $out/bin/solaar-cli - install -Dm644 -t $out/etc/udev/rules.d rules.d/*.rules + install -Dm444 -t $out/etc/udev/rules.d rules.d/*.rules ''; - enableParallelBuilding = true; + # No tests + doCheck = false; + meta = with lib; { description = "Linux devices manager for the Logitech Unifying Receiver"; longDescription = '' - Solaar is a Linux device manager for Logitech’s Unifying Receiver - peripherals. It is able to pair/unpair devices to the receiver, and for - most devices read battery status. + Solaar is a Linux manager for many Logitech keyboards, mice, and trackpads that + connect wirelessly to a USB Unifying, Lightspeed, or Nano receiver, connect + directly via a USB cable, or connect via Bluetooth. Solaar does not work with + peripherals from other companies. - It comes in two flavors, command-line and GUI. Both are able to list the - devices paired to a Unifying Receiver, show detailed info for each - device, and also pair/unpair supported devices with the receiver. + Solaar can be used as a GUI application or via its command-line interface. - To be able to use it, make sure you have access to /dev/hidraw* files. + This tool requires either to be run with root/sudo or alternatively to have the udev rules files installed. On NixOS this can be achieved by setting `hardware.logitech.wireless.enable`. ''; - license = licenses.gpl2; homepage = "https://pwr-solaar.github.io/Solaar/"; - platforms = platforms.linux; + license = licenses.gpl2Only; maintainers = with maintainers; [ spinus ysndr ]; + platforms = platforms.linux; }; }