nix/module/common/Keyd.nix

69 lines
1.9 KiB
Nix
Raw Normal View History

2024-04-24 04:22:34 +03:00
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [ keyd ];
services.keyd = {
enable = true;
keyboards.default = {
ids = [ "*" ];
settings = {
main = {
capslock = "overload(control, esc)";
2024-04-24 17:57:39 +03:00
compose = "layer(layer_macro)";
esc = "capslock";
2024-04-24 17:57:39 +03:00
rightalt = "layer(layer_rightalt)";
rightcontrol = "layer(layer_control)";
rightshift = "layer(layer_rightshift)";
leftcontrol = "overload(layer_alternative, leftcontrol)";
};
2024-04-24 04:22:34 +03:00
2024-04-24 17:57:39 +03:00
layer_alternative = {
2024-04-24 04:22:34 +03:00
w = "pageup";
a = "home";
s = "pagedown";
d = "end";
x = "cut";
c = "copy";
v = "paste";
h = "left";
j = "down";
k = "up";
l = "right";
};
2024-04-24 17:57:39 +03:00
layer_control = {
space = "playpause";
w = "volumeup";
s = "volumedown";
d = "nextsong";
a = "previoussong";
};
2024-04-24 04:22:34 +03:00
2024-04-24 17:57:39 +03:00
layer_macro = {
2024-04-24 04:22:34 +03:00
w = "macro(enter 10ms r enter)";
a = "macro(enter 10ms N o enter)";
s = "macro(enter 10ms W a i t enter)";
d = "macro(enter 10ms Y e s enter)";
q = "macro(enter 10ms S o r r y ! enter)";
e = "macro(enter 10ms T h a n k s ! enter)";
g = "macro(enter 10ms g g enter)";
z = "macro(enter 10ms < space L e f t enter)";
x = "macro(enter 10ms > space H e r e space < enter)";
c = "macro(enter 10ms > space R i g h t enter)";
r = "macro(enter 10ms N e e d space m o r e space a m m o enter)";
t = "macro(enter 10ms M a y space I space t a k e space e x t r a ? enter)";
f = "macro(enter 10ms A F K enter)";
v = "macro(enter 10ms I space n e e d space h e l p ! enter)";
b = "macro(enter 10ms I ' m space b a c k enter)";
};
2024-04-24 17:57:39 +03:00
# Vacant layers.
layer_rightalt = {};
layer_rightshift = {};
};
};
};
2024-04-24 04:58:58 +03:00
# HACK: Workaround for https://github.com/NixOS/nixpkgs/issues/290161
users.groups.keyd = {};
systemd.services.keyd.serviceConfig.CapabilityBoundingSet = [ "CAP_SETGID" ];
}