From 91098d29eb8f5ef9159753860f34b8ca928b3aaf Mon Sep 17 00:00:00 2001 From: "Alexandre Cavalheiro S. Tiago da Silva" Date: Sun, 15 Sep 2024 22:32:44 -0300 Subject: [PATCH] udev: fix rules for my monsgeek m1 --- nixos.nix | 14 ++++++++++---- services/udev/wb32dfu.nix | 19 +++++++++++++++++++ services/udev/wb32dfu.rules | 2 ++ 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 services/udev/wb32dfu.nix create mode 100644 services/udev/wb32dfu.rules diff --git a/nixos.nix b/nixos.nix index f8ebad8..04f32da 100644 --- a/nixos.nix +++ b/nixos.nix @@ -250,10 +250,16 @@ in users = [ "wizardlink" ]; }; - # Vial udev rule for Monsgeek M1 - services.udev.extraRules = '' - KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0005", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" - ''; + services.udev = { + # Vial udev rule for Monsgeek M1 + extraRules = '' + # Monsgeek M1 + KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="fffe", ATTRS{idProduct}=="0005", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" + ''; + + # WB32 DFU rules - needed for flashing + packages = [ (pkgs.callPackage ./services/udev/wb32dfu.nix { }) ]; + }; # enable a better driver for wireless xbox controllers. hardware.xpadneo.enable = true; diff --git a/services/udev/wb32dfu.nix b/services/udev/wb32dfu.nix new file mode 100644 index 0000000..d277fbc --- /dev/null +++ b/services/udev/wb32dfu.nix @@ -0,0 +1,19 @@ +{ + stdenv, +}: + +stdenv.mkDerivation { + pname = "wb32dfu-udev-rules"; + version = "0-unstable-2024-09-15"; + src = ./.; + + dontBuild = true; + + installPhase = '' + runHook preInstall + + install -D wb32dfu.rules $out/lib/udev/rules.d/50-wb32dfu.rules + + runHook postInstall + ''; +} diff --git a/services/udev/wb32dfu.rules b/services/udev/wb32dfu.rules new file mode 100644 index 0000000..925fdcc --- /dev/null +++ b/services/udev/wb32dfu.rules @@ -0,0 +1,2 @@ +# WB32 DFU +SUBSYSTEMS=="usb", ATTRS{idVendor}=="342d", ATTRS{idProduct}=="dfa0", TAG+="uaccess"