Unverified Commit dfcc2580 authored by Michele Guerini Rocco's avatar Michele Guerini Rocco Committed by GitHub
Browse files

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

xorg.xkeyboardconfig_custom: update for 2.39
parents 93da236e e4ab8a7d
Loading
Loading
Loading
Loading
+33 −4
Original line number Diff line number Diff line
@@ -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  ] };
          };
        '';
      };
  };
}
+0 −22
Original line number Diff line number Diff line
@@ -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>