Merge pull request #244174 from rnhmjoj/pr-fix-extra-layouts

xorg.xkeyboardconfig_custom: update for 2.39
This commit is contained in:
Michele Guerini Rocco 2023-07-19 08:13:13 +02:00 committed by GitHub
commit dfcc258054
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 26 deletions

View file

@ -29,10 +29,10 @@ let
mkKeyboardTest = layout: { extraConfig ? {}, tests }: with pkgs.lib; makeTest {
name = "keymap-${layout}";
machine.console.keyMap = mkOverride 900 layout;
machine.services.xserver.desktopManager.xterm.enable = false;
machine.services.xserver.layout = mkOverride 900 layout;
machine.imports = [ ./common/x11.nix extraConfig ];
nodes.machine.console.keyMap = mkOverride 900 layout;
nodes.machine.services.xserver.desktopManager.xterm.enable = false;
nodes.machine.services.xserver.layout = mkOverride 900 layout;
nodes.machine.imports = [ ./common/x11.nix extraConfig ];
testScript = ''
import json
@ -201,4 +201,33 @@ in pkgs.lib.mapAttrs mkKeyboardTest {
extraConfig.console.keyMap = "de";
extraConfig.services.xserver.layout = "de";
};
custom = {
tests = {
us.qwerty = [ "a" "b" "g" "d" "z" "shift-2" "shift-3" ];
us.expect = [ "a" "b" "g" "d" "z" "@" "#" ];
greek.qwerty = map (x: "alt_r-${x}")
[ "a" "b" "g" "d" "z" ];
greek.expect = [ "α" "β" "γ" "δ" "ζ" ];
};
extraConfig.console.useXkbConfig = true;
extraConfig.services.xserver.layout = "us-greek";
extraConfig.services.xserver.extraLayouts.us-greek =
{ description = "US layout with alt-gr greek";
languages = [ "eng" ];
symbolsFile = pkgs.writeText "us-greek" ''
xkb_symbols "us-greek"
{
include "us(basic)"
include "level3(ralt_switch)"
key <LatA> { [ a, A, Greek_alpha ] };
key <LatB> { [ b, B, Greek_beta ] };
key <LatG> { [ g, G, Greek_gamma ] };
key <LatD> { [ d, D, Greek_delta ] };
key <LatZ> { [ z, Z, Greek_zeta ] };
};
'';
};
};
}

View file

@ -579,28 +579,6 @@ self: super:
${optionalString (symbolsFile != null) "cp '${symbolsFile}' 'symbols/${name}'"}
${optionalString (typesFile != null) "cp '${typesFile}' 'types/${name}'"}
# patch makefiles
for type in compat geometry keycodes symbols types; do
if ! test -f "$type/${name}"; then
continue
fi
test "$type" = geometry && type_name=geom || type_name=$type
${ed}/bin/ed -v $type/Makefile.am <<EOF
/''${type_name}_DATA =
a
${name} \\
.
w
EOF
${ed}/bin/ed -v $type/Makefile.in <<EOF
/''${type_name}_DATA =
a
${name} \\
.
w
EOF
done
# add model description
${ed}/bin/ed -v rules/base.xml <<EOF
/<\/modelList>