Files
lhns--steam-frame-nix/modules/keyboard-layout.nix
T
Pierre Kisters 1ad0dd751e modules/cleanup.nix: orphan cleanup on every switch
Every module imports cleanup.nix (also exported as
homeManagerModules.cleanup), which
- puts steam-frame-nix-cleanup (install.sh cleanup) on PATH;
- runs `cleanup --orphans --quiet` after linkGeneration on every switch,
  keeping what the configuration still uses (steamFrame.cleanup.keep, set
  by the modules: debugger while steamvrDebugger is on, the Firefox desktop
  profile's user.js while its fix applies); in a dry run it runs with
  --dry-run;
- runs `cleanup --all` instead when Home Manager's `uninstall = true;` is
  set (the manual uninstall route);
- removes links of older versions at paths Home Manager is about to own
  before checkLinkTargets (steamFrame.cleanup.migrateLinks), which would
  count as collisions otherwise.

install.sh cleanup gains --quiet (only actions, deferrals and warnings;
the header only when something is printed). The Jellyfin module's own
removal of the old shim copy goes: cleanup does it.
2026-09-29 00:01:30 +02:00

41 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 = [
./cleanup.nix
(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";
};
}