keychron-udev-rules: init at 23-10-2025 (#454769)
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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 ];
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user