summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorLin Jian <me@linj.tech>2024-05-07 11:05:26 +0800
committerGitHub <noreply@github.com>2024-05-07 11:05:26 +0800
commit50f535b0671fc32d9206c5156823b88cdca6e345 (patch)
tree89cdbf2fbdbe49cbb0b8a65ef740492c35418aaf /nixos
parentf8b16525d1548e04c1c27d1a095970e3b8ff18e8 (diff)
parent75a864edf1e78ecb75860ad6366b8984e36e5736 (diff)
Merge pull request #309609 from linj-fork/pr/kanata-module-doc
nixos/kanata: improve doc
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/hardware/kanata.nix31
1 files changed, 10 insertions, 21 deletions
diff --git a/nixos/modules/services/hardware/kanata.nix b/nixos/modules/services/hardware/kanata.nix
index 333b2d2a88a5..c7e0e93baf6e 100644
--- a/nixos/modules/services/hardware/kanata.nix
+++ b/nixos/modules/services/hardware/kanata.nix
@@ -5,6 +5,8 @@ with lib;
let
cfg = config.services.kanata;
+ upstreamDoc = "See [the upstream documentation](https://github.com/jtroo/kanata/blob/main/docs/config.adoc) and [example config files](https://github.com/jtroo/kanata/tree/main/cfg_samples) for more information.";
+
keyboard = {
options = {
devices = mkOption {
@@ -22,28 +24,16 @@ let
type = types.lines;
example = ''
(defsrc
- grv 1 2 3 4 5 6 7 8 9 0 - = bspc
- tab q w e r t y u i o p [ ] \
- caps a s d f g h j k l ; ' ret
- lsft z x c v b n m , . / rsft
- lctl lmet lalt spc ralt rmet rctl)
-
- (deflayer qwerty
- grv 1 2 3 4 5 6 7 8 9 0 - = bspc
- tab q w e r t y u i o p [ ] \
- @cap a s d f g h j k l ; ' ret
- lsft z x c v b n m , . / rsft
- lctl lmet lalt spc ralt rmet rctl)
-
- (defalias
- ;; tap within 100ms for capslk, hold more than 100ms for lctl
- cap (tap-hold 100 100 caps lctl))
+ caps)
+
+ (deflayermap (default-layer)
+ ;; tap caps lock as caps lock, hold caps lock as left control
+ caps (tap-hold 100 100 caps lctl))
'';
description = ''
Configuration other than `defcfg`.
- See [example config files](https://github.com/jtroo/kanata)
- for more information.
+ ${upstreamDoc}
'';
};
extraDefCfg = mkOption {
@@ -55,8 +45,7 @@ let
from the devices option) and
`linux-continue-if-no-devs-found` (hardcoded to be yes).
- See [example config files](https://github.com/jtroo/kanata)
- for more information.
+ ${upstreamDoc}
'';
};
extraArgs = mkOption {
@@ -153,7 +142,7 @@ in
options.services.kanata = {
enable = mkEnableOption "kanata, a tool to improve keyboard comfort and usability with advanced customization";
package = mkPackageOption pkgs "kanata" {
- example = "kanata-with-cmd";
+ example = [ "kanata-with-cmd" ];
extraDescription = ''
::: {.note}
If {option}`danger-enable-cmd` is enabled in any of the keyboards, the