ctucx.git: nixfiles

ctucx' nixfiles

commit fb41c2fc43ddd3675fe9cbaeab44e7cac24f92a8
parent 39d03b12142823c8bf71e40474420f8a5fb5688e
Author: Leah (ctucx) <git@ctu.cx>
Date: Mon, 27 Mar 2023 15:30:06 +0200

configurations/darwin/keyboard: use `system.keyboard` option to remap keys
1 file changed, 7 insertions(+), 32 deletions(-)
M
configurations/darwin/keyboard.nix
|
39
+++++++--------------------------------
diff --git a/configurations/darwin/keyboard.nix b/configurations/darwin/keyboard.nix
@@ -10,41 +10,16 @@
     };
   };
 
-  hidutil = {
-    enable = true;
-    remapKeys = [
+  system.keyboard = {
+    enableKeyMapping = true;
+    userKeyMapping = [
       {
-        # Internal keyboard (Macbook Air 2020)
-        VendorID       = "5ac";
-        ProductID      = "281";
-        UserKeyMapping = [
-          # Remap tilde on non-US keyboards
-          { HIDKeyboardModifierMappingSrc = 30064771172; HIDKeyboardModifierMappingDst = 30064771125; }
-          # Swap right_command and right_option
-          { HIDKeyboardModifierMappingSrc = 30064771303; HIDKeyboardModifierMappingDst = 30064771302; }
-          { HIDKeyboardModifierMappingSrc = 30064771302; HIDKeyboardModifierMappingDst = 30064771303; }
-        ];
+        HIDKeyboardModifierMappingSrc = 30064771303;
+        HIDKeyboardModifierMappingDst = 30064771302;
       }
       {
-        # Internal keyboard (Macbook Air 2022)
-        LocationID     = "a1";
-        UserKeyMapping = [
-          # Swap right_command and right_option
-          { HIDKeyboardModifierMappingSrc = 30064771303; HIDKeyboardModifierMappingDst = 30064771302; }
-          { HIDKeyboardModifierMappingSrc = 30064771302; HIDKeyboardModifierMappingDst = 30064771303; }
-        ];
-      }
-      {
-        # Trackpoint Keyboard 2
-        VendorID       = "17ef";
-        ProductID      = "60ee";
-        UserKeyMapping = [
-          # Swap left_command and left_option
-          { HIDKeyboardModifierMappingSrc = 30064771299; HIDKeyboardModifierMappingDst = 30064771298; }
-          { HIDKeyboardModifierMappingSrc = 30064771298; HIDKeyboardModifierMappingDst = 30064771299; }
-          # Remap PrintScreen to left_command
-          { HIDKeyboardModifierMappingSrc = 30064771142; HIDKeyboardModifierMappingDst = 30064771299; }
-        ];
+        HIDKeyboardModifierMappingSrc = 30064771302;
+        HIDKeyboardModifierMappingDst = 30064771303;
       }
     ];
   };