Skip to content

Commit

Permalink
Switch from kanata to keyd
Browse files Browse the repository at this point in the history
  • Loading branch information
arunoruto committed Nov 12, 2024
1 parent 12fdd56 commit b3425c0
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 31 deletions.
4 changes: 3 additions & 1 deletion modules/nixos/services/input/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
{
imports = [
./kanata.nix
./keyd.nix
./touchpad.nix
./vial.nix
];

kanata.enable = lib.mkDefault true;
services.kanata.enable = lib.mkDefault false;
services.keyd.enable = lib.mkDefault true;
touchpad.enable = lib.mkDefault false;
vial.enable = lib.mkDefault false;
}
50 changes: 23 additions & 27 deletions modules/nixos/services/input/kanata.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,32 @@
...
}:
{
options = {
kanata.enable = lib.mkEnableOption "Enable kanata for keyboard remapping";
};
# options.kanata.enable = lib.mkEnableOption "Enable kanata for keyboard remapping";

config = lib.mkIf config.kanata.enable {
services = {
kanata = {
enable = true;
keyboards."base".config = ''
(defsrc
caps
)
# config = lib.mkIf config.kanata.enable {
services = {
kanata = {
# enable = true;
keyboards."base".config = ''
(defsrc
caps
)
(defalias
esccaps (tap-hold 100 100 esc esc)
)
(defalias
esccaps (tap-hold 100 100 esc esc)
)
(deflayer base
@esccaps
)
'';
};
udev = {
packages = with pkgs; [
kanata
];
# extraRules = ''
# KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
# '';
};
(deflayer base
@esccaps
)
'';
};
udev = {
packages = [ pkgs.unstable.kanata ];
# extraRules = ''
# KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput"
# '';
};
};
# };
}
15 changes: 15 additions & 0 deletions modules/nixos/services/input/keyd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
services.keyd = {
keyboards = {
default = {
ids = [ "*" ];
settings = {
main = {
capslock = "overload(meta, esc)";
esc = "overload(esc, capslock)";
};
};
};
};
};
}
4 changes: 1 addition & 3 deletions modules/nixos/services/input/vial.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
...
}:
{
options = {
vial.enable = lib.mkEnableOption "Support vial for custom keyboards";
};
options.vial.enable = lib.mkEnableOption "Support vial for custom keyboards";

config = lib.mkIf config.vial.enable {
# Packages with udev rules
Expand Down

0 comments on commit b3425c0

Please sign in to comment.