Files
lhns--steam-frame-nix/modules/keyboard-layout.nix
T
Pierre Kisters 2dc9ccb83e Home Manager modules for the Steam Frame
Portal fix, Steam-session keyboard layout, VR keyboard patch, hidden
apps, clipboard-sync and a Firefox Flatpak launcher, all under
steamFrame.*, plus the outer-session user-services mechanism.
2026-09-27 15:09:13 +02:00

38 lines
1.4 KiB
Nix

# Keyboard layout for the Steam session. gamescope (and its Xwayland displays
# :0/:1) uses xkbcommon defaults, i.e. US, unless XKB_DEFAULT_* is set. KDE's
# layout setting only applies to the nested desktop. systemd --user on the
# Frame does not pick up ~/.config/environment.d, so set it directly on the
# unit that launches gamescope. Takes effect the next time the Steam session
# starts.
{ config, lib, ... }:
let
cfg = config.steamFrame;
in {
options.steamFrame = {
keyboardLayout = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
example = "de";
description = ''
XKB layout for the Steam session (XKB_DEFAULT_LAYOUT). null leaves
gamescope's default (US) and writes no drop-in.
'';
};
keyboardVariant = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
example = "nodeadkeys";
description = "XKB variant for the Steam session (XKB_DEFAULT_VARIANT).";
};
};
config = lib.mkIf (cfg.keyboardLayout != null || cfg.keyboardVariant != null) {
xdg.configFile."systemd/user/gamescope-session.service.d/keyboard.conf".text =
"[Service]\n"
+ lib.optionalString (cfg.keyboardLayout != null)
"Environment=XKB_DEFAULT_LAYOUT=${cfg.keyboardLayout}\n"
+ lib.optionalString (cfg.keyboardVariant != null)
"Environment=XKB_DEFAULT_VARIANT=${cfg.keyboardVariant}\n";
};
}