From 701e7ee70f9d43c88e8d925e78f43263a1d4981f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Fri, 29 Sep 2023 14:10:29 +0200 Subject: [PATCH] feat(hardware): add SoloKeys udev rules --- hardware/base.nix | 2 +- hardware/solokeys.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 hardware/solokeys.nix diff --git a/hardware/base.nix b/hardware/base.nix index d8b098b..e790d69 100644 --- a/hardware/base.nix +++ b/hardware/base.nix @@ -1,7 +1,7 @@ { lib, pkgs, ... }: { - imports = [ ./firmware.nix ./zsa.nix ]; + imports = [ ./firmware.nix ./solokeys.nix ./zsa.nix ]; boot.supportedFilesystems = lib.mkDefault [ "btrfs" ]; boot.kernelPackages = lib.mkOverride 800 pkgs.linuxPackages_latest; diff --git a/hardware/solokeys.nix b/hardware/solokeys.nix new file mode 100644 index 0000000..7de1037 --- /dev/null +++ b/hardware/solokeys.nix @@ -0,0 +1,25 @@ +_: + +{ + services.udev.extraRules = '' + # Notify ModemManager this device should be ignored + ACTION!="add|change|move", GOTO="mm_usb_device_blacklist_end" + SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end" + ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_end" + + ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", ENV{ID_MM_DEVICE_IGNORE}="1" + + LABEL="mm_usb_device_blacklist_end" + + + # Solo bootloader + firmware access + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess" + SUBSYSTEM=="tty", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="a2ca", TAG+="uaccess" + + # ST DFU access + SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", TAG+="uaccess" + + # U2F Zero + SUBSYSTEM=="hidraw", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="8acf", TAG+="uaccess" + ''; +}