Merge pull request #309609 from linj-fork/pr/kanata-module-doc

nixos/kanata: improve doc
This commit is contained in:
Lin Jian 2024-05-07 11:05:26 +08:00 committed by GitHub
commit 50f535b067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,6 +5,8 @@ with lib;
let let
cfg = config.services.kanata; 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 = { keyboard = {
options = { options = {
devices = mkOption { devices = mkOption {
@ -22,28 +24,16 @@ let
type = types.lines; type = types.lines;
example = '' example = ''
(defsrc (defsrc
grv 1 2 3 4 5 6 7 8 9 0 - = bspc caps)
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 (deflayermap (default-layer)
grv 1 2 3 4 5 6 7 8 9 0 - = bspc ;; tap caps lock as caps lock, hold caps lock as left control
tab q w e r t y u i o p [ ] \ caps (tap-hold 100 100 caps lctl))
@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))
''; '';
description = '' description = ''
Configuration other than `defcfg`. Configuration other than `defcfg`.
See [example config files](https://github.com/jtroo/kanata) ${upstreamDoc}
for more information.
''; '';
}; };
extraDefCfg = mkOption { extraDefCfg = mkOption {
@ -55,8 +45,7 @@ let
from the devices option) and from the devices option) and
`linux-continue-if-no-devs-found` (hardcoded to be yes). `linux-continue-if-no-devs-found` (hardcoded to be yes).
See [example config files](https://github.com/jtroo/kanata) ${upstreamDoc}
for more information.
''; '';
}; };
extraArgs = mkOption { extraArgs = mkOption {
@ -153,7 +142,7 @@ in
options.services.kanata = { options.services.kanata = {
enable = mkEnableOption "kanata, a tool to improve keyboard comfort and usability with advanced customization"; enable = mkEnableOption "kanata, a tool to improve keyboard comfort and usability with advanced customization";
package = mkPackageOption pkgs "kanata" { package = mkPackageOption pkgs "kanata" {
example = "kanata-with-cmd"; example = [ "kanata-with-cmd" ];
extraDescription = '' extraDescription = ''
::: {.note} ::: {.note}
If {option}`danger-enable-cmd` is enabled in any of the keyboards, the If {option}`danger-enable-cmd` is enabled in any of the keyboards, the