nix/module/common/Keyd.nix

57 lines
1.3 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";
# space = "macro2(1, 100, macro(space))"; # NOTE: Possible bhop example.
2024-04-24 04:22:34 +03:00
};
2024-04-24 17:57:39 +03:00
layer_control = {
space = "playpause";
w = "volumeup";
s = "volumedown";
2024-04-25 04:10:00 +03:00
d = "forward";
a = "back";
e = "nextsong";
q = "previoussong";
2024-04-30 19:00:27 +03:00
x = "mute";
2024-04-24 17:57:39 +03:00
};
2024-04-24 04:22:34 +03:00
2024-04-25 00:58:09 +03:00
layer_macro = {};
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" ];
}