From 4a0819805a6e389bb5e37a72d8d41345b1ad4a1a Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 19 Dec 2019 12:26:45 +0000 Subject: [PATCH 1/3] wooting-udev-rules: init at 20190601 Signed-off-by: David Wood --- .../linux/wooting-udev-rules/default.nix | 23 +++++++++++++++++++ .../linux/wooting-udev-rules/wooting.rules | 9 ++++++++ pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 pkgs/os-specific/linux/wooting-udev-rules/default.nix create mode 100644 pkgs/os-specific/linux/wooting-udev-rules/wooting.rules diff --git a/pkgs/os-specific/linux/wooting-udev-rules/default.nix b/pkgs/os-specific/linux/wooting-udev-rules/default.nix new file mode 100644 index 000000000000..49da843e3ad9 --- /dev/null +++ b/pkgs/os-specific/linux/wooting-udev-rules/default.nix @@ -0,0 +1,23 @@ +{ stdenv }: + +stdenv.mkDerivation rec { + pname = "wooting-udev-rules"; + version = "20190601"; + + # Source: https://wooting.helpscoutdocs.com/article/68-wootility-configuring-device-access-for-wootility-under-linux-udev-rules + src = [ ./wooting.rules ]; + + unpackPhase = ":"; + + installPhase = '' + install -Dpm644 $src $out/lib/udev/rules.d/70-wooting.rules + ''; + + meta = with stdenv.lib; { + homepage = https://wooting.helpscoutdocs.com/article/34-linux-udev-rules; + description = "udev rules that give NixOS permission to communicate with Wooting keyboards"; + platforms = platforms.linux; + license = "unknown"; + maintainers = with maintainers; [ davidtwco ]; + }; +} diff --git a/pkgs/os-specific/linux/wooting-udev-rules/wooting.rules b/pkgs/os-specific/linux/wooting-udev-rules/wooting.rules new file mode 100644 index 000000000000..d906df3d4c6a --- /dev/null +++ b/pkgs/os-specific/linux/wooting-udev-rules/wooting.rules @@ -0,0 +1,9 @@ +# Wooting One +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff01", MODE:="0660", GROUP="input" +# Wooting One update mode +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2402", MODE:="0660", GROUP="input" + +# Wooting Two +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="ff02", MODE:="0660", GROUP="input" +# Wooting Two update mode +SUBSYSTEM=="hidraw", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2403", MODE:="0660", GROUP="input" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 39b764537f7e..ab90b14e41f8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -17052,6 +17052,8 @@ in wirelesstools = callPackage ../os-specific/linux/wireless-tools { }; + wooting-udev-rules = callPackage ../os-specific/linux/wooting-udev-rules { }; + wpa_supplicant = callPackage ../os-specific/linux/wpa_supplicant { }; wpa_supplicant_gui = libsForQt5.callPackage ../os-specific/linux/wpa_supplicant/gui.nix { }; From 47d402e4f70bc96daed0f8cc4bd9d94bea4cedce Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 19 Dec 2019 12:28:30 +0000 Subject: [PATCH 2/3] wootility: init at 3.3.3 Signed-off-by: David Wood --- pkgs/tools/misc/wootility/default.nix | 32 +++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 pkgs/tools/misc/wootility/default.nix diff --git a/pkgs/tools/misc/wootility/default.nix b/pkgs/tools/misc/wootility/default.nix new file mode 100644 index 000000000000..e88322f7f756 --- /dev/null +++ b/pkgs/tools/misc/wootility/default.nix @@ -0,0 +1,32 @@ +{ appimageTools, fetchurl, lib, gsettings-desktop-schemas, gtk3, udev, wooting-udev-rules }: + +let + pname = "wootility"; + version = "3.3.3"; +in +appimageTools.wrapType2 rec { + name = "${pname}-${version}"; + + src = fetchurl { + url = "https://s3.eu-west-2.amazonaws.com/wooting-update/wootility-linux-latest/wootility-${version}.AppImage"; + sha256 = "1qdiacwnvqahqkrhwnblz0jjywn63c6ndl3z450myhx5x55fdcja"; + }; + + profile = '' + export LC_ALL=C.UTF-8 + export XDG_DATA_DIRS="${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS" + ''; + + multiPkgs = extraPkgs; + extraPkgs = + pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) ++ ([ udev wooting-udev-rules ]); + extraInstallCommands = "mv $out/bin/{${name},${pname}}"; + + meta = with lib; { + homepage = https://wooting.io/wootility; + description = "Wootility is customization and management software for Wooting keyboards."; + platforms = [ "x86_64-linux" ]; + license = "unknown"; + maintainers = with maintainers; [ davidtwco ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ab90b14e41f8..de240791c11a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7078,6 +7078,8 @@ in woof = callPackage ../tools/misc/woof { }; + wootility = callPackage ../tools/misc/wootility { }; + wpscan = callPackage ../tools/security/wpscan { }; wsmancli = callPackage ../tools/system/wsmancli {}; From 33f4d93e0308631255eb04629c28dab0acda50d3 Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 19 Dec 2019 12:29:20 +0000 Subject: [PATCH 3/3] nixos/wooting: add `hardware.wooting` module Signed-off-by: David Wood --- nixos/modules/hardware/wooting.nix | 12 ++++++++++++ nixos/modules/module-list.nix | 1 + 2 files changed, 13 insertions(+) create mode 100644 nixos/modules/hardware/wooting.nix diff --git a/nixos/modules/hardware/wooting.nix b/nixos/modules/hardware/wooting.nix new file mode 100644 index 000000000000..ee550cbbf6b8 --- /dev/null +++ b/nixos/modules/hardware/wooting.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, ... }: + +with lib; +{ + options.hardware.wooting.enable = + mkEnableOption "Enable support for Wooting keyboards"; + + config = mkIf config.hardware.wooting.enable { + environment.systemPackages = [ pkgs.wootility ]; + services.udev.packages = [ pkgs.wooting-udev-rules ]; + }; +} diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 3300848220a0..886156a3e494 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -63,6 +63,7 @@ ./hardware/steam-hardware.nix ./hardware/usb-wwan.nix ./hardware/onlykey.nix + ./hardware/wooting.nix ./hardware/video/amdgpu.nix ./hardware/video/amdgpu-pro.nix ./hardware/video/ati.nix