Snippet #2391 (python)

  • #2391
Expires in: 0 minutes View Raw
  1. commit f60118c5c8ea8a6527d5f8fc7bbe6adc99126e4e
  2. Author: Nadrieril <nadrieril@gmail.com>
  3. Date:   Sun Jul 8 13:14:36 2018 +0100
  4.  
  5.    nixos/xserver: use xkbDir setting when validating/converting configuration
  6.  
  7. diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix
  8. index 6bf8c653e11..8ec910ce93a 100644
  9. --- a/nixos/modules/config/i18n.nix
  10. +++ b/nixos/modules/config/i18n.nix
  11. @@ -120,7 +120,7 @@ with lib;
  12.       mkIf config.i18n.consoleUseXkbConfig
  13.         (pkgs.runCommand "xkb-console-keymap" { preferLocalBuild = true; } ''
  14.           '${pkgs.ckbcomp}/bin/ckbcomp' -model '${xkbModel}' -layout '${layout}' \
  15. -            -option '${xkbOptions}' -variant '${xkbVariant}' > "$out"
  16. +            -option '${xkbOptions}' -variant '${xkbVariant}' -I '${xkbDir}' > "$out"
  17.         '');
  18.     environment.systemPackages =
  19. diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix
  20. index 0237dd6f560..0e62c888052 100644
  21. --- a/nixos/modules/services/x11/xserver.nix
  22. +++ b/nixos/modules/services/x11/xserver.nix
  23. @@ -687,10 +687,10 @@ in
  24.     services.xserver.xkbDir = mkDefault "${pkgs.xkeyboard_config}/etc/X11/xkb";
  25.     system.extraDependencies = singleton (pkgs.runCommand "xkb-validated" {
  26. -      inherit (cfg) xkbModel layout xkbVariant xkbOptions;
  27. +      inherit (cfg) xkbModel layout xkbVariant xkbOptions xkbDir;
  28.       nativeBuildInputs = [ pkgs.xkbvalidate ];
  29.     } ''
  30. -      validate "$xkbModel" "$layout" "$xkbVariant" "$xkbOptions"
  31. +      validate "$xkbModel" "$layout" "$xkbVariant" "$xkbOptions" "$xkbDir"
  32.       touch "$out"
  33.     '');
  34. diff --git a/pkgs/tools/X11/xkbvalidate/xkbvalidate.c b/pkgs/tools/X11/xkbvalidate/xkbvalidate.c
  35. index d9c9042467c..2c0b218a0e8 100644
  36. --- a/pkgs/tools/X11/xkbvalidate/xkbvalidate.c
  37. +++ b/pkgs/tools/X11/xkbvalidate/xkbvalidate.c
  38. @@ -96,13 +96,14 @@ int main(int argc, char **argv)
  39.     struct xkb_context *ctx;
  40.     struct xkb_rule_names *rdef;
  41. -    if (argc != 5) {
  42. -        fprintf(stderr, "Usage: %s model layout variant options\n", argv[0]);
  43. +    if (argc != 6) {
  44. +        fprintf(stderr, "Usage: %s model layout variant options dir\n", argv[0]);
  45.         return EXIT_FAILURE;
  46.     }
  47. -    ctx = xkb_context_new(XKB_CONTEXT_NO_ENVIRONMENT_NAMES);
  48. +    ctx = xkb_context_new(XKB_CONTEXT_NO_ENVIRONMENT_NAMES || XKB_CONTEXT_NO_DEFAULT_INCLUDES);
  49.     xkb_context_set_log_fn(ctx, add_log);
  50. +    xkb_context_include_path_append(ctx, argv[5]);
  51.     rdef = malloc(sizeof(struct xkb_rule_names));

Reply to this snippet →

Honeypot, don't fill.
⌘+⏎ or Ctrl+⏎