2025-05-15 23:02:11 -04:00
|
|
|
{ inputs, pkgs, ... }:
|
2025-05-16 13:35:05 -04:00
|
|
|
let
|
2025-02-16 16:24:34 -05:00
|
|
|
|
2025-05-16 13:35:05 -04:00
|
|
|
k-vars = ''
|
|
|
|
(defvar
|
|
|
|
tap-timeout 100
|
|
|
|
hold-timeout 200)
|
|
|
|
'';
|
|
|
|
|
|
|
|
in
|
2025-02-16 16:24:34 -05:00
|
|
|
{
|
2025-05-15 23:02:11 -04:00
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.kanata
|
|
|
|
];
|
2025-02-19 12:37:50 -05:00
|
|
|
|
|
|
|
# Add the Kanata service user to necessary groups
|
|
|
|
systemd.services.kanata-razer.serviceConfig = {
|
|
|
|
SupplementaryGroups = [
|
|
|
|
"input"
|
|
|
|
"uinput"
|
|
|
|
"openrazer"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2025-02-16 16:24:34 -05:00
|
|
|
services.kanata = {
|
|
|
|
enable = true;
|
2025-05-16 13:35:05 -04:00
|
|
|
|
2025-02-16 16:24:34 -05:00
|
|
|
keyboards = {
|
|
|
|
sinc = {
|
2025-02-18 17:37:55 -05:00
|
|
|
devices = [ "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd"
|
|
|
|
"/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-if02"
|
|
|
|
"/dev/input/by-id/usb-Keebio_Sinc_Rev._4-if02-event-joystick" ];
|
2025-05-16 13:35:05 -04:00
|
|
|
extraDefCfg = ''
|
|
|
|
process-unmapped-keys yes
|
|
|
|
concurrent-tap-hold yes
|
2025-05-16 15:18:48 -04:00
|
|
|
allow-hardware-repeat false
|
2025-05-16 13:35:05 -04:00
|
|
|
'';
|
|
|
|
|
2025-02-16 16:24:34 -05:00
|
|
|
config = ''
|
|
|
|
(defsrc
|
2025-02-18 17:37:55 -05:00
|
|
|
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc
|
2025-02-16 16:24:34 -05:00
|
|
|
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
tab q w e r t y u i o p [ ] bspc end
|
|
|
|
caps a s d f g h j k l ; ' ret pgup
|
|
|
|
lsft z x c v b n m , . / rsft up pgdn
|
|
|
|
lctl slck lmet lalt spc ralt rmet rctrl left down right)
|
|
|
|
|
2025-05-16 13:35:05 -04:00
|
|
|
${k-vars}
|
|
|
|
|
2025-02-16 16:24:34 -05:00
|
|
|
(defalias
|
2025-05-16 13:35:05 -04:00
|
|
|
supesc (tap-hold-press $tap-timeout $hold-timeout esc lmet)
|
|
|
|
sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft)
|
|
|
|
sp-rsft (tap-hold-press $tap-timeout $hold-timeout S-0 lsft)
|
2025-05-16 15:18:48 -04:00
|
|
|
controls (layer-while-held media-controls)
|
|
|
|
nav (tap-hold-press $tap-timeout $hold-timeout a (layer-while-held navigation)))
|
2025-02-16 16:24:34 -05:00
|
|
|
|
|
|
|
(deflayer qwerty
|
2025-02-18 17:37:55 -05:00
|
|
|
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc
|
2025-02-16 16:24:34 -05:00
|
|
|
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
tab q w e r t y u i o p [ ] bspc end
|
|
|
|
@supesc a s d f g h j k l ; ' ret pgup
|
|
|
|
@sp-lsft z x c v b n m , . / @sp-rsft up pgdn
|
|
|
|
lmet @controls lalt lctrl spc rctrl ralt rmet left down right)
|
|
|
|
|
2025-05-16 15:18:48 -04:00
|
|
|
(deflayer navigation
|
|
|
|
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtsc
|
2025-02-16 16:24:34 -05:00
|
|
|
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
tab q w e r t y u i o p [ ] bspc end
|
2025-05-16 15:18:48 -04:00
|
|
|
@supesc a s d f g left down up right ; ' ret pgup
|
|
|
|
@sp-lsft z x c v b n m , . / @sp-rsft up pgdn
|
|
|
|
lmet @controls lalt lctrl spc rctrl ralt rmet left down right)
|
2025-02-16 16:24:34 -05:00
|
|
|
|
2025-05-16 15:18:48 -04:00
|
|
|
(deflayer media-controls
|
|
|
|
esc VolumeMute VolumeDown VolumeUp f4 MediaTrackPrevious MediaPlayPause MediaTrackNext f8 f9 f10 f11 f12 prtsc
|
|
|
|
grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
tab q w e r t y u i o MediaPlayPause [ ] bspc end
|
|
|
|
@supesc a s d f g MediaTrackNext VolumeDown VolumeUp MediaTrackPrevious ; ' ret pgup
|
|
|
|
@sp-lsft z x c v b n VolumeMute , . / @sp-rsft pgup _
|
|
|
|
lmet lmet lalt lctrl spc rctrl ralt rmet home pgdn end)
|
2025-02-16 16:24:34 -05:00
|
|
|
'';
|
|
|
|
};
|
2025-05-16 15:18:48 -04:00
|
|
|
|
|
|
|
# quefrency = {
|
|
|
|
# devices = [ "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd"
|
|
|
|
# "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-if02"
|
|
|
|
# "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-if02-event-joystick" ];
|
|
|
|
# extraDefCfg = ''
|
|
|
|
# process-unmapped-keys yes
|
|
|
|
# concurrent-tap-hold yes
|
|
|
|
# '';
|
|
|
|
|
|
|
|
# config = ''
|
|
|
|
# (defsrc
|
|
|
|
# grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
# tab q w e r t y u i o p [ ] bspc end
|
|
|
|
# caps a s d f g h j k l ; ' ret pgup
|
|
|
|
# lsft z x c v b n m , . / rsft up pgdn
|
|
|
|
# lctl slck lmet lalt spc ralt rmet rctrl left down right)
|
|
|
|
|
|
|
|
# ${k-vars}
|
|
|
|
|
|
|
|
# (defalias
|
|
|
|
# supesc (tap-hold-press $tap-timeout $hold-timeout esc lmet)
|
|
|
|
# sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft)
|
|
|
|
# sp-rsft (tap-hold-press $tap-timeout $hold-timeout S-0 lsft)
|
|
|
|
# controls (layer-while-held controls))
|
|
|
|
|
|
|
|
# (deflayer qwerty
|
|
|
|
# grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
# tab q w e r t y u i o p [ ] bspc end
|
|
|
|
# @supesc a s d f g h j k l ; ' ret pgup
|
|
|
|
# @sp-lsft z x c v b n m , . / @sp-rsft up pgdn
|
|
|
|
# lmet @controls lalt lctrl spc rctrl ralt rmet left down right)
|
|
|
|
|
|
|
|
# (deflayer controls
|
|
|
|
# grv 1 2 3 4 5 6 7 8 9 0 - = \ del home
|
|
|
|
# tab q w e r t y u i o MediaPlayPause [ ] bspc end
|
|
|
|
# @supesc a s d f g MediaTrackNext VolumeDown VolumeUp MediaTrackPrevious l ; ' ret pgup
|
|
|
|
# @sp-lsft z x c v b n VolumeMute , . / @sp-rsft pgup _
|
|
|
|
# lmet lmet lalt lctrl spc rctrl ralt rmet home pgdn end)
|
|
|
|
|
|
|
|
# '';
|
|
|
|
# }
|
|
|
|
|
|
|
|
razer = {
|
2025-02-18 17:37:55 -05:00
|
|
|
devices = [ "/dev/input/by-id/usb-Razer_Razer_Blade-event-kbd"
|
|
|
|
"/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd" ];
|
2025-02-16 16:24:34 -05:00
|
|
|
config = ''
|
|
|
|
(defsrc
|
|
|
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
|
|
|
tab q w e r t y u i o p [ ] \
|
|
|
|
caps a s d f g h j k l ; ' ret
|
|
|
|
lsft z x c v b n m , . / rsft
|
|
|
|
lctrl lmet lalt spc ralt rctrl)
|
|
|
|
|
2025-05-16 13:35:05 -04:00
|
|
|
${k-vars}
|
|
|
|
|
2025-02-16 16:24:34 -05:00
|
|
|
(defalias
|
2025-05-16 13:35:05 -04:00
|
|
|
supesc (tap-hold-press $tap-timeout $hold-timeout esc lmet)
|
|
|
|
sp-lsft (tap-hold-press $tap-timeout $hold-timeout S-9 lsft)
|
|
|
|
sp-rsft (tap-hold-press $tap-timeout $hold-timeout S-0 lsft))
|
2025-02-16 16:24:34 -05:00
|
|
|
|
|
|
|
(deflayer qwerty
|
|
|
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
|
|
|
tab q w e r t y u i o p [ ] \
|
|
|
|
@supesc a s d f g h j k l ; ' ret
|
|
|
|
@sp-lsft z x c v b n m , . / @sp-rsft
|
|
|
|
lmet lalt lctrl spc rctrl ralt)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|