-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkanata.nix
65 lines (57 loc) · 1.45 KB
/
kanata.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
config,
lib,
...
}:
with lib; let
defCfg = concatStringsSep "\n" [
"rapid-event-delay ${toString cfg.rapidEventDelay}"
cfg.extraDefCfg
];
cfg = config.akl;
in {
imports = [./layouts];
options.akl = {
enable = mkEnableOption "enable alt keyboard layout";
layout = mkOption {
type = types.str;
default = "graphite";
description = "Choose which layout you want to enable";
};
variant = mkOption {
type = types.str;
default = "ansi";
description = "Choose the keyboard variant you use";
};
rapidEventDelay = mkOption {
type = types.int;
default = 5;
description = "Set Delay for rapid events. Useful to fix chords and one-shot shifts not working as intended.";
};
devices = mkOption {
type = types.listOf types.str;
default = [];
description = "List of input devices for kanata to intercept. Empty list detects all keyboards.";
};
config = mkOption {
type = types.str;
default = "";
description = "Additional kanata configuration (e.g., defalias, defchord).";
};
extraDefCfg = mkOption {
type = types.str;
default = "";
description = "kanata defcfg options.";
};
};
config = {
services.kanata = mkIf cfg.enable {
enable = true;
keyboards.akl = {
extraDefCfg = defCfg;
config = cfg.layoutConfig + cfg.config;
inherit (cfg) devices;
};
};
};
}