diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2018-01-10 19:48:04 +0100 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2018-01-10 19:57:23 +0100 |
| commit | 2989a747db1b5ee7960d6428ba58e59dd619f5f8 (patch) | |
| tree | 4171bcee7aeaba110c8dcca4410a239a9b40483b /modules/system | |
| parent | e0d8d10e92788e55641d7f95ed72e53c9cf1ed5c (diff) | |
keyboard: add option for remapping Tilde on non-us keyboards
Diffstat (limited to 'modules/system')
| -rw-r--r-- | modules/system/keyboard.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/system/keyboard.nix b/modules/system/keyboard.nix index b9b77d6..d4b7c8f 100644 --- a/modules/system/keyboard.nix +++ b/modules/system/keyboard.nix @@ -26,6 +26,12 @@ in description = "Whether to remap the Caps Lock key to Escape."; }; + system.keyboard.nonUS.remapTilde = mkOption { + type = types.bool; + default = false; + description = "Whether to remap the Tilde key on non-us keyboards."; + }; + system.keyboard.userKeyMapping = mkOption { internal = true; type = types.listOf (types.attrsOf types.int); @@ -42,9 +48,10 @@ in warnings = mkIf (!cfg.enableKeyMapping && cfg.userKeyMapping != []) [ "system.keyboard.enableKeyMapping is not enabled, keyboard mappings will not be configured." ]; - system.keyboard.userKeyMapping = mkMerge [ - (mkIf cfg.remapCapsLockToControl [{ HIDKeyboardModifierMappingSrc = 30064771129; HIDKeyboardModifierMappingDst = 30064771296; }]) - (mkIf cfg.remapCapsLockToEscape [{ HIDKeyboardModifierMappingSrc = 30064771129; HIDKeyboardModifierMappingDst = 30064771113; }]) + system.keyboard.userKeyMapping = [ + (mkIf cfg.remapCapsLockToControl { HIDKeyboardModifierMappingSrc = 30064771129; HIDKeyboardModifierMappingDst = 30064771296; }) + (mkIf cfg.remapCapsLockToEscape { HIDKeyboardModifierMappingSrc = 30064771129; HIDKeyboardModifierMappingDst = 30064771113; }) + (mkIf cfg.nonUS.remapTilde { HIDKeyboardModifierMappingSrc = 30064771172; HIDKeyboardModifierMappingDst = 30064771125; }) ]; system.activationScripts.keyboard.text = optionalString cfg.enableKeyMapping '' |
