{ config, lib, ... }: { options.zpha.services.keyd.enable = lib.mkEnableOption "keyd"; config = lib.mkIf config.zpha.services.keyd.enable { users.groups.keyd = { }; systemd.services.keyd.serviceConfig = { CapabilityBoundingSet = [ "CAP_SETGID" ]; }; environment.etc."libinput/local-overrides.quirks".text = '' [Serial Keyboards] MatchUdevType=keyboard MatchName=keyd virtual keyboard AttrKeyboardIntegration=internal ''; services.keyd = { enable = true; keyboards = { any = { ids = [ "*" ]; settings.main = { "leftcontrol" = "leftalt"; "leftalt" = "leftcontrol"; "s+d" = "oneshot(shift)"; "f+j" = "space"; "j+k" = "backspace"; "k+l" = "enter"; }; }; }; }; }; }