initrd: Provide configuration needed for xkbcommon
@@ -4,6 +4,21 @@ let
key-held = pkgs.runCommand "key-held.mrb" {} ''
${pkgs.buildPackages.mruby}/bin/mrbc -o $out ${../boot/applets}/key-held.rb
'';
+ minimalX11Config = pkgs.runCommandNoCC "minimalX11Config" {
+ allowedReferences = [ "out" ];
+ } ''
+ (PS4=" $ "; set -x
+ mkdir -p $out
+ cp -r ${pkgs.xlibs.xkeyboardconfig}/share/X11/xkb $out/xkb
+ cp -r ${pkgs.xlibs.libX11.out}/share/X11/locale $out/locale
+ )
+
+ for f in $(grep -lIiR '${pkgs.xlibs.libX11.out}' $out); do
+ printf ':: substituting original path for $out in "%s".\n' "$f"
+ substituteInPlace $f \
+ --replace "${pkgs.xlibs.libX11.out}/share/X11/locale/en_US.UTF-8/Compose" "$out/locale/en_US.UTF-8/Compose"
+ done
+ '';
in
{
mobile.boot.stage-1.contents = with pkgs; [
@@ -27,9 +42,19 @@ in
object = key-held;
symlink = "/applets/key-held.mrb";
}
+ {
+ object = "${minimalX11Config}";
+ symlink = "/etc/X11";
+ }
];
+
mobile.boot.stage-1.extraUtils = with pkgs; [
# Used for `key-held.mrb`.
{ package = evtest; }
];
+
+ mobile.boot.stage-1.environment = {
+ XKB_CONFIG_ROOT = "/etc/X11/xkb";
+ XLOCALEDIR = "/etc/X11/locale";
+ };
}
