Merge pull request #57337 from peterhoeg/m/logitech
nixos: better support for logitech devices and update relevant packages
This commit is contained in:
commit
61613a2512
28
nixos/modules/hardware/logitech.nix
Normal file
28
nixos/modules/hardware/logitech.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.hardware.logitech;
|
||||
|
||||
in {
|
||||
options.hardware.logitech = {
|
||||
enable = mkEnableOption "Logitech Devices";
|
||||
|
||||
enableGraphical = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable graphical support applications.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
pkgs.ltunify
|
||||
] ++ lib.optional cfg.enableGraphical pkgs.solaar;
|
||||
|
||||
# ltunifi and solaar both provide udev rules but the most up-to-date have been split
|
||||
# out into a dedicated derivation
|
||||
services.udev.packages = with pkgs; [ logitech-udev-rules ];
|
||||
};
|
||||
}
|
|
@ -46,6 +46,7 @@
|
|||
./hardware/sensor/iio.nix
|
||||
./hardware/ksm.nix
|
||||
./hardware/ledger.nix
|
||||
./hardware/logitech.nix
|
||||
./hardware/mcelog.nix
|
||||
./hardware/network/b43.nix
|
||||
./hardware/nitrokey.nix
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
{fetchFromGitHub, stdenv, gtk3, pythonPackages, gobject-introspection}:
|
||||
pythonPackages.buildPythonApplication rec {
|
||||
{ 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
|
||||
|
||||
python3Packages.buildPythonApplication rec {
|
||||
pname = "solaar-unstable";
|
||||
version = "2019-01-30";
|
||||
|
||||
|
@ -10,7 +14,8 @@ pythonPackages.buildPythonApplication rec {
|
|||
sha256 = "0xg181xcwzzs8pdqvjrkjyaaga7ir93hzjvd17j9g3ns8xfj2mvr";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [pythonPackages.pygobject3 pythonPackages.pyudev gobject-introspection gtk3];
|
||||
propagatedBuildInputs = with python3Packages; [ gobject-introspection gtk3 pygobject3 pyudev ];
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/solaar" \
|
||||
--prefix PYTHONPATH : "$PYTHONPATH" \
|
||||
|
@ -19,12 +24,12 @@ pythonPackages.buildPythonApplication rec {
|
|||
--prefix PYTHONPATH : "$PYTHONPATH" \
|
||||
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
|
||||
|
||||
mkdir -p $out/lib/udev/rules.d
|
||||
cp rules.d/*.rules $out/lib/udev/rules.d/
|
||||
install -Dm644 -t $out/etc/udev/rules.d rules.d/*.rules
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
meta = with stdenv.lib; {
|
||||
|
||||
meta = with lib; {
|
||||
description = "Linux devices manager for the Logitech Unifying Receiver";
|
||||
longDescription = ''
|
||||
Solaar is a Linux device manager for Logitech’s Unifying Receiver
|
||||
|
@ -40,6 +45,6 @@ pythonPackages.buildPythonApplication rec {
|
|||
license = licenses.gpl2;
|
||||
homepage = https://pwr.github.io/Solaar/;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [maintainers.spinus maintainers.ysndr];
|
||||
maintainers = with maintainers; [ spinus ysndr ];
|
||||
};
|
||||
}
|
||||
|
|
19
pkgs/os-specific/linux/logitech-udev-rules/default.nix
Normal file
19
pkgs/os-specific/linux/logitech-udev-rules/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ stdenv, solaar }:
|
||||
|
||||
# ltunifi and solaar both provide udev rules but solaar's rules are more
|
||||
# up-to-date so we simply use that instead of having to maintain our own rules
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "logitech-udev-rules-${version}";
|
||||
inherit (solaar) version;
|
||||
|
||||
buildCommand = ''
|
||||
install -Dm644 -t $out/etc/udev/rules.d ${solaar.src}/rules.d/*.rules
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "udev rules for Logitech devices";
|
||||
inherit (solaar.meta) homepage license platforms;
|
||||
maintainers = with maintainers; [ peterhoeg ];
|
||||
};
|
||||
}
|
|
@ -1,12 +1,17 @@
|
|||
{ stdenv, fetchgit }:
|
||||
{ stdenv, fetchFromGitHub }:
|
||||
|
||||
# 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
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "ltunify-20140331";
|
||||
name = "ltunify-${version}";
|
||||
version = "unstable-20180330";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://git.lekensteyn.nl/ltunify.git";
|
||||
rev = "c3a263ff97bcd31e96abbfed33d066f8d2778f58";
|
||||
sha256 = "04g7mmljkx8643k53yd9x4k2ndrr98w7fbq10qn8ll6didkph3v8";
|
||||
src = fetchFromGitHub {
|
||||
owner = "Lekensteyn";
|
||||
repo = "ltunify";
|
||||
rev = "f664d1d41d5c4beeac5b81e485c3498f13109db7";
|
||||
sha256 = "07sqhih9jmm7vgiwqsjzihd307cj7l096sxjl25p7nwr1q4180wv";
|
||||
};
|
||||
|
||||
makeFlags = [ "DESTDIR=$(out)" "bindir=/bin" ];
|
||||
|
@ -15,7 +20,7 @@ stdenv.mkDerivation rec {
|
|||
description = "Tool for working with Logitech Unifying receivers and devices";
|
||||
homepage = https://lekensteyn.nl/logitech-unifying.html;
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ abbradar ];
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ maintainers.abbradar ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15935,6 +15935,8 @@ in
|
|||
|
||||
lobster-two = callPackage ../data/fonts/lobster-two {};
|
||||
|
||||
logitech-udev-rules = callPackage ../os-specific/linux/logitech-udev-rules {};
|
||||
|
||||
# lohit-fonts.assamese lohit-fonts.bengali lohit-fonts.devanagari lohit-fonts.gujarati lohit-fonts.gurmukhi
|
||||
# lohit-fonts.kannada lohit-fonts.malayalam lohit-fonts.marathi lohit-fonts.nepali lohit-fonts.odia
|
||||
# lohit-fonts.tamil-classical lohit-fonts.tamil lohit-fonts.telugu
|
||||
|
|
Loading…
Reference in a new issue