Commit 6e34ca27 authored by kruziikrel13's avatar kruziikrel13
Browse files

keychron-udev-rules: init at 23-10-2025

parent 752df2ba
Loading
Loading
Loading
Loading
+37 −0
Original line number Diff line number Diff line
{
  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 ];
  };
})