117 lines
2.9 KiB
Nix
117 lines
2.9 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
console = {
|
|
keyMap = ./mine.map;
|
|
earlySetup = true;
|
|
packages = [ pkgs.terminus_font ];
|
|
font =
|
|
if config.hrnz.graphical.hidpi then
|
|
"${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz"
|
|
else
|
|
"Lat2-Terminus16";
|
|
};
|
|
|
|
# xkb overlays for use with libxkbcommon
|
|
environment.etc."xkb".source = ./xkb;
|
|
|
|
# use this for the legacy display server
|
|
# we cannot name our layout de(mine) without substantial effort
|
|
# Let's go for mine(mine) instead.
|
|
services.xserver.xkb = lib.mkIf (config.hrnz.graphical.desktop == "plasma") {
|
|
variant = lib.mkForce "mine";
|
|
layout = lib.mkForce "mine";
|
|
extraLayouts.mine = {
|
|
description = "ergonomic German layout based on Neo";
|
|
languages = [ "deu" ];
|
|
symbolsFile = ./xkb/symbols/de;
|
|
};
|
|
};
|
|
|
|
# gdm reads this file even though it does not use X11.
|
|
environment.etc."X11/xorg.conf.d/00-keyboard.conf" = lib.mkIf (config.hrnz.graphical.desktop == "gnome") {
|
|
text = lib.mkForce ''
|
|
Section "InputClass"
|
|
Identifier "Keyboard catchall"
|
|
MatchIsKeyboard "on"
|
|
Option "XkbModel" "pc104"
|
|
Option "XkbLayout" "de"
|
|
Option "XkbOptions" ""
|
|
Option "XkbVariant" "mine"
|
|
EndSection
|
|
'';
|
|
};
|
|
|
|
# for device addresses, see /proc/bus/input/devices
|
|
# for keycodes and actions, use evtest
|
|
services.udev.extraHwdb = ''
|
|
evdev:atkbd:dmi:bvnLENOVO*
|
|
KEYBOARD_KEY_ea=pageup
|
|
KEYBOARD_KEY_e9=pagedown
|
|
KEYBOARD_KEY_b8=capslock
|
|
KEYBOARD_KEY_38=rightalt
|
|
KEYBOARD_KEY_3a=leftalt
|
|
|
|
evdev:input:b0003v258Ap001E*
|
|
KEYBOARD_KEY_700e6=capslock
|
|
KEYBOARD_KEY_700e2=rightalt
|
|
KEYBOARD_KEY_70039=leftalt
|
|
|
|
evdev:input:b0003vB404p0101*
|
|
KEYBOARD_KEY_700e6=capslock
|
|
KEYBOARD_KEY_700e2=rightalt
|
|
KEYBOARD_KEY_70039=leftalt
|
|
'';
|
|
|
|
environment.etc."inputrc".source = pkgs.writeText "inputrc" ''
|
|
#TODO: document which typewriter-emulator sends which control sequence
|
|
|
|
set bell-style none
|
|
|
|
set meta-flag on
|
|
set input-meta on
|
|
set convert-meta off
|
|
set output-meta on
|
|
set colored-stats on
|
|
|
|
"\e[5~": beginning-of-history
|
|
"\e[6~": end-of-history
|
|
|
|
"\e[1~": beginning-of-line
|
|
"\e[7~": beginning-of-line
|
|
"\e[H": beginning-of-line
|
|
"\eOH": beginning-of-line
|
|
|
|
"\e[4~": end-of-line
|
|
"\e[8~": end-of-line
|
|
"\e[F": end-of-line
|
|
"\eOF": end-of-line
|
|
|
|
"\e[3~": delete-char
|
|
# sometimes also C-<del>
|
|
#"\e[3;5~": delete-char
|
|
|
|
"\e[2~": quoted-insert
|
|
|
|
"\C-H": backward-kill-word
|
|
|
|
"\e[3;5~": kill-word
|
|
"\e[3^": kill-word
|
|
|
|
"\e[1;5H": unix-line-discard
|
|
"\e[7^": unix-line-discard
|
|
|
|
"\e[1;5F": kill-line
|
|
"\e[8^": kill-line
|
|
|
|
"\eOc": forward-word
|
|
"\e[5C": forward-word
|
|
"\e[1;5C": forward-word
|
|
|
|
"\eOd": backward-word
|
|
"\e[5D": backward-word
|
|
"\e[1;5D": backward-word
|
|
|
|
'';
|
|
}
|