From 513143fe4ef0734483640945250b39d1732f7298 Mon Sep 17 00:00:00 2001 From: davidak Date: Sun, 11 Apr 2021 05:25:53 +0200 Subject: [PATCH] kbd: add tests and update them --- nixos/tests/keymap.nix | 27 +++++++++++++++++++++++--- pkgs/os-specific/linux/kbd/default.nix | 4 +++- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/nixos/tests/keymap.nix b/nixos/tests/keymap.nix index 09d5d2a6c9e1..a18a05f90c6d 100644 --- a/nixos/tests/keymap.nix +++ b/nixos/tests/keymap.nix @@ -107,17 +107,32 @@ in pkgs.lib.mapAttrs mkKeyboardTest { altgr.expect = [ "~" "#" "{" "[" "|" ]; }; - extraConfig.console.keyMap = "azerty/fr"; + extraConfig.console.keyMap = "fr"; extraConfig.services.xserver.layout = "fr"; }; + bone = { + tests = { + layer1.qwerty = [ "f" "j" ]; + layer1.expect = [ "e" "n" ]; + layer2.qwerty = [ "shift-f" "shift-j" "shift-6" ]; + layer2.expect = [ "E" "N" "$" ]; + layer3.qwerty = [ "caps_lock-d" "caps_lock-f" ]; + layer3.expect = [ "{" "}" ]; + }; + + extraConfig.console.keyMap = "bone"; + extraConfig.services.xserver.layout = "de"; + extraConfig.services.xserver.xkbVariant = "bone"; + }; + colemak = { tests = { homerow.qwerty = [ "a" "s" "d" "f" "j" "k" "l" "semicolon" ]; homerow.expect = [ "a" "r" "s" "t" "n" "e" "i" "o" ]; }; - extraConfig.console.keyMap = "colemak/colemak"; + extraConfig.console.keyMap = "colemak"; extraConfig.services.xserver.layout = "us"; extraConfig.services.xserver.xkbVariant = "colemak"; }; @@ -129,9 +144,13 @@ in pkgs.lib.mapAttrs mkKeyboardTest { symbols.qwerty = [ "q" "w" "e" "minus" "equal" ]; symbols.expect = [ "'" "," "." "[" "]" ]; }; + + extraConfig.console.keyMap = "dvorak"; + extraConfig.services.xserver.layout = "us"; + extraConfig.services.xserver.xkbVariant = "dvorak"; }; - dvp = { + dvorak-programmer = { tests = { homerow.qwerty = [ "a" "s" "d" "f" "j" "k" "l" "semicolon" ]; homerow.expect = [ "a" "o" "e" "u" "h" "t" "n" "s" ]; @@ -142,6 +161,7 @@ in pkgs.lib.mapAttrs mkKeyboardTest { symbols.expect = [ "&" "[" "{" "}" "(" "=" "*" ")" "+" "]" "!" ]; }; + extraConfig.console.keyMap = "dvorak-programmer"; extraConfig.services.xserver.layout = "us"; extraConfig.services.xserver.xkbVariant = "dvp"; }; @@ -156,6 +176,7 @@ in pkgs.lib.mapAttrs mkKeyboardTest { layer3.expect = [ "{" "}" ]; }; + extraConfig.console.keyMap = "neo"; extraConfig.services.xserver.layout = "de"; extraConfig.services.xserver.xkbVariant = "neo"; }; diff --git a/pkgs/os-specific/linux/kbd/default.nix b/pkgs/os-specific/linux/kbd/default.nix index e709523f4524..396546eec9f8 100644 --- a/pkgs/os-specific/linux/kbd/default.nix +++ b/pkgs/os-specific/linux/kbd/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, autoreconfHook, +{ lib, stdenv, fetchurl, nixosTests, autoreconfHook, pkg-config, flex, check, pam, coreutils }: @@ -42,6 +42,8 @@ stdenv.mkDerivation rec { buildInputs = [ check pam ]; nativeBuildInputs = [ autoreconfHook pkg-config flex ]; + passthru.tests = nixosTests.keymap; + meta = with lib; { homepage = "https://kbd-project.org/"; description = "Linux keyboard tools and keyboard maps";