refactor(nix/darwin): Swap ESC<->CapsLock with Kanata

This commit is contained in:
Ahmad Ansori Palembani 2024-11-08 11:11:41 +07:00
parent b48174745d
commit da9dcf8bdc
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
7 changed files with 99 additions and 14 deletions

View file

@ -0,0 +1,25 @@
{ user }:
{ pkgs, ... }:
{
launchd.user.agents.kanata = {
command = "/usr/bin/sudo ${pkgs.kanata}/bin/kanata -c ${../../../include/kanata.kbd} -n";
serviceConfig = {
UserName = user;
RunAtLoad = true;
KeepAlive = {
SuccessfulExit = false;
Crashed = true;
};
StandardErrorPath = "/Users/${user}/.logs/kanata.err.log";
StandardOutPath = "/Users/${user}/.logs/kanata.out.log";
ProcessType = "Interactive";
Nice = -30;
};
};
security.sudo.extraConfig = ''
${user} ALL=(ALL) NOPASSWD: ${pkgs.kanata}/bin/kanata
'';
}