commit f60118c5c8ea8a6527d5f8fc7bbe6adc99126e4e Author: Nadrieril Date: Sun Jul 8 13:14:36 2018 +0100 nixos/xserver: use xkbDir setting when validating/converting configuration diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index 6bf8c653e11..8ec910ce93a 100644 --- a/nixos/modules/config/i18n.nix +++ b/nixos/modules/config/i18n.nix @@ -120,7 +120,7 @@ with lib; mkIf config.i18n.consoleUseXkbConfig (pkgs.runCommand "xkb-console-keymap" { preferLocalBuild = true; } '' '${pkgs.ckbcomp}/bin/ckbcomp' -model '${xkbModel}' -layout '${layout}' \ - -option '${xkbOptions}' -variant '${xkbVariant}' > "$out" + -option '${xkbOptions}' -variant '${xkbVariant}' -I '${xkbDir}' > "$out" ''); environment.systemPackages = diff --git a/nixos/modules/services/x11/xserver.nix b/nixos/modules/services/x11/xserver.nix index 0237dd6f560..0e62c888052 100644 --- a/nixos/modules/services/x11/xserver.nix +++ b/nixos/modules/services/x11/xserver.nix @@ -687,10 +687,10 @@ in services.xserver.xkbDir = mkDefault "${pkgs.xkeyboard_config}/etc/X11/xkb"; system.extraDependencies = singleton (pkgs.runCommand "xkb-validated" { - inherit (cfg) xkbModel layout xkbVariant xkbOptions; + inherit (cfg) xkbModel layout xkbVariant xkbOptions xkbDir; nativeBuildInputs = [ pkgs.xkbvalidate ]; } '' - validate "$xkbModel" "$layout" "$xkbVariant" "$xkbOptions" + validate "$xkbModel" "$layout" "$xkbVariant" "$xkbOptions" "$xkbDir" touch "$out" ''); diff --git a/pkgs/tools/X11/xkbvalidate/xkbvalidate.c b/pkgs/tools/X11/xkbvalidate/xkbvalidate.c index d9c9042467c..2c0b218a0e8 100644 --- a/pkgs/tools/X11/xkbvalidate/xkbvalidate.c +++ b/pkgs/tools/X11/xkbvalidate/xkbvalidate.c @@ -96,13 +96,14 @@ int main(int argc, char **argv) struct xkb_context *ctx; struct xkb_rule_names *rdef; - if (argc != 5) { - fprintf(stderr, "Usage: %s model layout variant options\n", argv[0]); + if (argc != 6) { + fprintf(stderr, "Usage: %s model layout variant options dir\n", argv[0]); return EXIT_FAILURE; } - ctx = xkb_context_new(XKB_CONTEXT_NO_ENVIRONMENT_NAMES); + ctx = xkb_context_new(XKB_CONTEXT_NO_ENVIRONMENT_NAMES || XKB_CONTEXT_NO_DEFAULT_INCLUDES); xkb_context_set_log_fn(ctx, add_log); + xkb_context_include_path_append(ctx, argv[5]); rdef = malloc(sizeof(struct xkb_rule_names));