feat: Add virtual kbd device of kanata for qemu capture

This commit is contained in:
ulic-youthlic 2026-05-22 14:48:14 +08:00
parent bfef1951a3
commit 788f606319
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
2 changed files with 20 additions and 1 deletions

View file

@ -64,7 +64,6 @@
openssh.enable = true;
steam.enable = true;
tailscale.enable = true;
kanata.enable = true;
transmission.enable = true;
nix-ld.enable = true;
juicity.client.enable = true;

View file

@ -0,0 +1,20 @@
{lib, ...}: {
youthlic.programs.kanata.enable = true;
services = {
udev.extraRules = ''
KERNEL=="event*", ATTRS{name}=="kanata-virtual-kbd", SYMLINK+="input/kanata-kbd"
'';
kanata.keyboards.default = {
devices = [
"/dev/input/by-id/usb-RDR_Crush_80-event-kbd"
];
extraDefCfg = ''
linux-output-device-name "kanata-virtual-kbd"
'';
};
};
systemd.services.kanata-default.serviceConfig = {
PrivateUsers = lib.mkForce false;
DynamicUser = lib.mkForce false;
};
}