2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
|
|
|
|
commaSep = builtins.concatStringsSep ",";
|
2022-06-21 19:34:55 +02:00
|
|
|
xkbOptions = ["compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle"];
|
2022-05-08 22:01:27 +02:00
|
|
|
languages = {
|
|
|
|
|
de = "T3";
|
|
|
|
|
gr = "polytonic";
|
|
|
|
|
ru = "phonetic";
|
|
|
|
|
ara = "buckwalter";
|
2022-11-07 15:42:38 +01:00
|
|
|
cop = "";
|
|
|
|
|
ave = "";
|
|
|
|
|
"in" = "san-kagapa";
|
2022-11-09 11:07:44 +01:00
|
|
|
il = "phonetic";
|
2022-05-08 22:01:27 +02:00
|
|
|
};
|
|
|
|
|
defaultLanguage = "de";
|
2019-08-27 17:24:33 +02:00
|
|
|
in {
|
2022-04-25 11:34:07 +02:00
|
|
|
# man 7 xkeyboard-config
|
2019-04-19 03:11:51 +02:00
|
|
|
services.xserver = {
|
2022-06-05 17:24:11 +02:00
|
|
|
layout = "de";
|
2022-04-25 11:52:27 +02:00
|
|
|
# T3: https://upload.wikimedia.org/wikipedia/commons/a/a9/German-Keyboard-Layout-T3-Version1-large.png
|
|
|
|
|
# buckwalter: http://www.qamus.org/transliteration.htm
|
2022-06-05 17:24:11 +02:00
|
|
|
xkbVariant = "T3";
|
2022-11-09 11:07:44 +01:00
|
|
|
xkbOptions = commaSep xkbOptions;
|
2019-04-19 03:11:51 +02:00
|
|
|
libinput.enable = true;
|
2022-11-07 15:42:38 +01:00
|
|
|
xkbDir = pkgs.symlinkJoin {
|
|
|
|
|
name = "x-keyboard-directory";
|
|
|
|
|
paths = [
|
|
|
|
|
"${pkgs.xkeyboard_config}/etc/X11/xkb"
|
|
|
|
|
(pkgs.linkFarm "custom-x-keyboards" [
|
|
|
|
|
{
|
|
|
|
|
name = "symbols/cop";
|
|
|
|
|
path = pkgs.fetchurl {
|
|
|
|
|
url = "http://www.moheb.de/download/cop";
|
|
|
|
|
sha256 = "1l0h6aq536hyinrh0i0ia355y229bjrlibii0sya5bmqh46vycia";
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
name = "symbols/ave";
|
|
|
|
|
path = pkgs.fetchurl {
|
|
|
|
|
url = "https://blog.simos.info/wp-content/uploads/2010/06/avestan.txt";
|
|
|
|
|
sha256 = "192zmmm3gxyhim39dsax7r87gsay2w5v2xkhwmvsfipjb60hwp5g";
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
];
|
|
|
|
|
};
|
2019-04-19 03:11:51 +02:00
|
|
|
};
|
|
|
|
|
|
2020-04-22 17:42:45 +02:00
|
|
|
console.keyMap = "de";
|
2020-05-31 18:24:15 +02:00
|
|
|
|
2022-05-08 22:01:27 +02:00
|
|
|
environment.systemPackages =
|
|
|
|
|
lib.mapAttrsToList
|
|
|
|
|
(language: variant:
|
|
|
|
|
pkgs.writers.writeDashBin "kb-${language}" ''
|
2022-06-21 19:34:55 +02:00
|
|
|
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage},${language} ${languages.${defaultLanguage}},${variant} ${toString (map (option: "-option ${option}") xkbOptions)}
|
2022-05-08 22:01:27 +02:00
|
|
|
'')
|
|
|
|
|
languages;
|
|
|
|
|
|
2020-05-31 18:24:15 +02:00
|
|
|
# improve held key rate
|
2022-03-10 21:52:12 +01:00
|
|
|
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
|
2022-04-25 11:38:10 +02:00
|
|
|
|
|
|
|
|
systemd.user.services.gxkb = {
|
|
|
|
|
wantedBy = ["graphical-session.target"];
|
|
|
|
|
serviceConfig = {
|
|
|
|
|
SyslogIdentifier = "gxkb";
|
|
|
|
|
ExecStart = "${pkgs.gxkb}/bin/gxkb";
|
|
|
|
|
Restart = "always";
|
|
|
|
|
RestartSec = "15s";
|
|
|
|
|
StartLimitBurst = 0;
|
|
|
|
|
};
|
|
|
|
|
};
|
2019-04-19 03:11:51 +02:00
|
|
|
}
|