Files
lhns--steam-frame-nix/modules/steam-close-button.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

32 lines
1.3 KiB
Nix

# Close (X) button on the dashboard's Steam window. SteamVR dashboard patch
# (steam-close-button/patch.js; "systemui" on 127.0.0.1:8087), registered only
# when enabled; enables steamvr-debugger.nix (one SteamVR restart the first time).
{ config, lib, pkgs, ... }:
let
cfg = config.steamFrame.dashboard.steamCloseButton;
inherit (import ./lib { inherit pkgs; }) mkPatch;
in {
imports = [ ./cleanup.nix ./steam-ui-patches.nix ./steamvr-debugger.nix ];
options.steamFrame.dashboard.steamCloseButton.enable = lib.mkEnableOption ''
a Close (X) button on the dashboard's Steam window. It hides Steam
(previous window or just the bar) until shown explicitly, e.g. via the
Steam tab, also across SteamVR restarts and reboots (in
~/.local/state/steam-frame-nix/ui-patches/steam-close-button.json).
SteamVR dashboard patch; off removes it (next switch)'';
config = lib.mkIf cfg.enable {
steamFrame.uiPatches.patches = [ {
name = "steam-close-button";
endpoint = "http://127.0.0.1:8087";
target.title = "systemui";
patch = mkPatch {
name = "steam-close-button";
src = ./steam-close-button/patch.js;
};
unpatch = ./steam-close-button/unpatch.js;
state = true; # "Steam hidden", kept across restarts
} ];
};
}