aboutsummaryrefslogtreecommitdiff
path: root/modules/workstation/hardware/xkblayout/default.nix
blob: a77068cfd92053422dc7a9eca1843219e30a6885 (plain)
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
/* KEYBOARD LAYOUT MODULE
 *
 * (INCOMPLETE) Setup keyboard layout
 * and overrides. Currently this is
 * mostly handled by GRAPHICS/I3 but
 * should maybe be moved here?
 */
{ pkgs, config, ... }:

{
  i18n.consoleUseXkbConfig = true;

  services.xserver = {
    layout = "us";
    xkbVariant = "altgr-intl";
    xkbOptions = "caps:hyper";

    # We want to set this layout modification as a per-device setting
    # to avoid interpreting hardware keyboards with the same
    # layout, which would otherwise lead to "double dvorak".
    extraConfig = ''
      Section "InputClass"
        Identifier "Internal Keyboard"
        MatchIsKeyboard "yes"
        MatchProduct "AT Translated Set 2 keyboard"
        Option "XkbLayout"  "dvorak"
        Option "XkbVariant" "altgr-intl"
        Option "XkbOptions" "caps:hyper"
      EndSection
    '';
  };  
}