Re-add kanata as a NixOS module for home row mods
https://www.youtube.com/watch?v=sLWQ4Gx88h4 https://www.youtube.com/watch?v=4yiMbP_ZySQ
This commit is contained in:
parent
99e0a8343f
commit
0c9c145abc
3 changed files with 77 additions and 7 deletions
|
@ -12,14 +12,24 @@
|
||||||
../../users/opdavies.nix
|
../../users/opdavies.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
cli.password-store = {
|
cli = {
|
||||||
enable = true;
|
kanata = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
extensions = with pkgs.passExtensions; [
|
devices = [
|
||||||
pass-audit
|
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||||
pass-otp
|
];
|
||||||
pass-update
|
};
|
||||||
];
|
|
||||||
|
password-store = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
extensions = with pkgs.passExtensions; [
|
||||||
|
pass-audit
|
||||||
|
pass-otp
|
||||||
|
pass-update
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
core = {
|
core = {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./docker.nix
|
./docker.nix
|
||||||
|
./kanata.nix
|
||||||
./podman.nix
|
./podman.nix
|
||||||
./password-store.nix
|
./password-store.nix
|
||||||
];
|
];
|
||||||
|
|
59
modules/nixos/cli/kanata.nix
Normal file
59
modules/nixos/cli/kanata.nix
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.cli.${service};
|
||||||
|
service = "kanata";
|
||||||
|
|
||||||
|
inherit (lib) mkEnableOption mkIf mkOption types;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.cli.${service} = {
|
||||||
|
enable = mkEnableOption "Enable ${service}";
|
||||||
|
|
||||||
|
devices = mkOption {
|
||||||
|
default = [];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
services.kanata = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
keyboards = {
|
||||||
|
default = {
|
||||||
|
devices = cfg.devices;
|
||||||
|
|
||||||
|
extraDefCfg = "process-unmapped-keys yes";
|
||||||
|
|
||||||
|
config = ''
|
||||||
|
(defsrc
|
||||||
|
caps a s d f j k l ;
|
||||||
|
)
|
||||||
|
|
||||||
|
(defvar
|
||||||
|
tap-time 150
|
||||||
|
hold-time 200
|
||||||
|
)
|
||||||
|
|
||||||
|
(defalias
|
||||||
|
escctrl (tap-hold 100 100 esc lctl)
|
||||||
|
a (tap-hold $tap-time $hold-time a lmet)
|
||||||
|
s (tap-hold $tap-time $hold-time s lalt)
|
||||||
|
d (tap-hold $tap-time $hold-time d lsft)
|
||||||
|
f (tap-hold $tap-time $hold-time f lctl)
|
||||||
|
j (tap-hold $tap-time $hold-time j rctl)
|
||||||
|
k (tap-hold $tap-time $hold-time k rsft)
|
||||||
|
l (tap-hold $tap-time $hold-time l ralt)
|
||||||
|
; (tap-hold $tap-time $hold-time ; rmet)
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayer base
|
||||||
|
@escctrl @a @s @d @f @j @k @l @;
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue