moved kanata config into its own directory with kanata.nix
This commit is contained in:
parent
ae6fda00a0
commit
eb01c9561f
5 changed files with 167 additions and 9 deletions
32
.config/nix/modules/kanata/kanata.nix
Normal file
32
.config/nix/modules/kanata/kanata.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{ config, libs, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
# Kanata setup
|
||||
# Mostly copied from https://dev.to/shanu-kumawat/how-to-set-up-kanata-on-nixos-a-step-by-step-guide-1jkc
|
||||
boot.kernelModules = [ "uinput" ]; # Enable uinput kernel module
|
||||
hardware.uinput.enable = true; # Enable uinput
|
||||
# Set up udev rules for uinput
|
||||
services.udev.extraRules = ''
|
||||
KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
|
||||
'';
|
||||
users.groups.uinput = { }; # ensure uinput group exists
|
||||
# Add Kanata service user to necessary groups
|
||||
systemd.services.kanata-internalKeyboard.serviceConfig = {
|
||||
SupplementaryGroups = [
|
||||
"input"
|
||||
"uinput"
|
||||
];
|
||||
};
|
||||
# Kanata configuration
|
||||
services.kanata = {
|
||||
enable = true;
|
||||
keyboards = {
|
||||
internalKeyboard = {
|
||||
devices = [
|
||||
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||
];
|
||||
configFile = builtins.readFile = ./conf.kbd;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue