mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 06:00:22 +02:00
- runtimeDir, userBus, outerBusEnv, userServices.*, portalFix.enable
-> session.{runtimeDir, bus, busEnv, services.*, portalFix.enable}
- keyboardLayout/keyboardVariant -> keyboard.layout/variant;
steamKeyboardPatch.enable -> keyboard.vr.extraKeys.enable
- hiddenApps -> launcherMenu.hiddenApps
- launcherMenu.launchDebounce -> launchDebounceSeconds (also the patch's
option key; launcher-menu-launch VERSION 3)
- "Steam UI patch" in option descriptions
Old names keep working with a rename warning (outerBusEnv is read-only:
reading it warns).
40 lines
1.4 KiB
Nix
40 lines
1.4 KiB
Nix
# Keyboard layout for the Steam session: gamescope uses xkbcommon defaults (US)
|
|
# unless XKB_DEFAULT_* is set; KDE's setting only covers the nested desktop.
|
|
# environment.d isn't read on the Frame, so it goes on gamescope-session.service
|
|
# (next session start).
|
|
{ config, lib, ... }:
|
|
let
|
|
cfg = config.steamFrame.keyboard;
|
|
in {
|
|
imports = [
|
|
(lib.mkRenamedOptionModule [ "steamFrame" "keyboardLayout" ] [ "steamFrame" "keyboard" "layout" ])
|
|
(lib.mkRenamedOptionModule [ "steamFrame" "keyboardVariant" ] [ "steamFrame" "keyboard" "variant" ])
|
|
];
|
|
|
|
options.steamFrame.keyboard = {
|
|
layout = lib.mkOption {
|
|
type = lib.types.nullOr lib.types.str;
|
|
default = null;
|
|
example = "de";
|
|
description = ''
|
|
XKB layout for the Steam session (XKB_DEFAULT_LAYOUT); null = US.
|
|
'';
|
|
};
|
|
variant = 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.layout != null || cfg.variant != null) {
|
|
xdg.configFile."systemd/user/gamescope-session.service.d/keyboard.conf".text =
|
|
"[Service]\n"
|
|
+ lib.optionalString (cfg.layout != null)
|
|
"Environment=XKB_DEFAULT_LAYOUT=${cfg.layout}\n"
|
|
+ lib.optionalString (cfg.variant != null)
|
|
"Environment=XKB_DEFAULT_VARIANT=${cfg.variant}\n";
|
|
};
|
|
}
|