keychron-udev-rules: init at 23-10-2025 (#454769)

This commit is contained in:
Gaétan Lepage
2025-10-23 07:54:54 +00:00
committed by GitHub
3 changed files with 48 additions and 2 deletions
+6
View File
@@ -13989,6 +13989,12 @@
name = "Tomas Krupka";
matrix = "@krupkat:matrix.org";
};
kruziikrel13 = {
github = "kruziikrel13";
name = "Michael Petersen";
email = "dev@michaelpetersen.io";
githubId = 72793125;
};
krzaczek = {
name = "Pawel Krzaczkowski";
email = "pawel@printu.pl";
+5 -2
View File
@@ -8,15 +8,18 @@
let
cfg = config.hardware.keyboard.qmk;
inherit (lib) mkEnableOption mkIf;
in
{
options.hardware.keyboard.qmk = {
enable = mkEnableOption "non-root access to the firmware of QMK keyboards";
keychronSupport = mkEnableOption "udev rules for keychron QMK based keyboards";
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.qmk-udev-rules ];
services.udev.packages = [
pkgs.qmk-udev-rules
]
++ lib.optionals cfg.keychronSupport [ pkgs.keychron-udev-rules ];
users.groups.plugdev = { };
};
}
@@ -0,0 +1,37 @@
{
lib,
stdenvNoCC,
udevCheckHook,
writeTextFile,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "keychron-udev-rules";
version = "23-10-2025";
nativeBuildInputs = [ udevCheckHook ];
src = writeTextFile {
name = "69-keychron.rules";
text = ''
KERNEL=="event*", SUBSYSTEM=="input", ENV{ID_VENDOR_ID}=="3434", ENV{ID_INPUT_JOYSTICK}=="*?", ENV{ID_INPUT_JOYSTICK}=""
'';
};
dontConfigure = true;
dontUnpack = true;
dontBuild = true;
dontFixup = true;
installPhase = ''
runHook preInstall
install -Dm644 $src $out/lib/udev/rules.d/69-keychron.rules
runHook postInstall
'';
meta = with lib; {
description = "Keychron Keyboard Udev Rules, fixes issues with keyboard detection on Linux";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ kruziikrel13 ];
};
})