From 44c073c07c34e04683837abfc02550a746ffe857 Mon Sep 17 00:00:00 2001 From: fruchti Date: Sun, 12 Mar 2023 12:55:59 +0100 Subject: [PATCH] Add udev rules for Keychron C2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without these, the function keys don’t work as function keys, but only as media keys. --- base/default.nix | 1 + base/hardware.nix | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 base/hardware.nix diff --git a/base/default.nix b/base/default.nix index 82802a5..5ae1d2a 100644 --- a/base/default.nix +++ b/base/default.nix @@ -7,5 +7,6 @@ ./packages.nix ./users.nix ./locale.nix + ./hardware.nix ]; } diff --git a/base/hardware.nix b/base/hardware.nix new file mode 100644 index 0000000..2195655 --- /dev/null +++ b/base/hardware.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + services.udev.extraRules = '' + # Keychron C2 function key fix + SUBSYSTEMS=="input", ATTRS{name}==Keychron C2", RUN+="${pkgs.coreutils}/bin/echo 0 | ${pkgs.coreutils}/bin/tee /sys/module/hid_apple/parameters/fnmode" + ''; +}