summary refs log tree commit diff
path: root/pkgs/applications/misc/solaar/default.nix
blob: 641353f53dafee4c20f83c351ba0c1f04fd5b9a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ fetchFromGitHub
, lib
, gobject-introspection
, gtk3
, python3Packages
, wrapGAppsHook
, gdk-pixbuf
, libappindicator
, librsvg
}:

# 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.6";

  src = fetchFromGitHub {
    owner = "pwr-Solaar";
    repo = "Solaar";
    rev = version;
    sha256 = "sha256-Ys0005hIQ+fT4oMeU5iFtbLNqn1WM6iLdIKGwdyn7BM=";
  };

  nativeBuildInputs = [ wrapGAppsHook gdk-pixbuf ];
  buildInputs = [ libappindicator librsvg ];

  propagatedBuildInputs = with python3Packages; [
    gobject-introspection
    gtk3
    psutil
    pygobject3
    pyudev
    pyyaml
    xlib
  ];

  # the -cli symlink is just to maintain compabilility with older versions where
  # there was a difference between the GUI and CLI versions.
  postInstall = ''
    ln -s $out/bin/solaar $out/bin/solaar-cli

    install -Dm444 -t $out/etc/udev/rules.d rules.d/*.rules
  '';

  # No tests
  doCheck = false;

  meta = with lib; {
    description = "Linux devices manager for the Logitech Unifying Receiver";
    longDescription = ''
      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.

      Solaar can be used as a GUI application or via its command-line interface.

      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`.
    '';
    homepage = "https://pwr-solaar.github.io/Solaar/";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ spinus ysndr ];
    platforms = platforms.linux;
  };
}