mirror of
https://github.com/lhns/steam-frame-nix.git
synced 2026-10-06 04:04:16 +02:00
Install: name what waits for a restart; uninstall survives a failed Nix uninstall
A fresh install into a running session left the keyboard layout and the SteamVR dashboard patches (VR pet, the VR keyboard's suggestion strip, ...) silently off until a reboot: gamescope reads XKB_DEFAULT_* only at its start, and SteamVR opens its DevTools port (VRWebHelper.DebuggerEnabled) only at its start. Neither can be applied at runtime. - install.sh restart-check (run on every switch by session.nix, and by install at its end): compares the keyboard-layout drop-in with the running gamescope session's environment and checks whether SteamVR runs without port 8087; install ends with "Restart once" listing them. - uninstall: a failing nix-installer uninstall (e.g. /nix busy) no longer aborts the script before the ~/.config/home-manager link and Home Manager state are removed; it says to reboot and run uninstall again. - cleanup check: restart-check on fake cgroup/proc dirs.
This commit is contained in:
1 parent
92e9d17e09
commit
6b12d5329f
7 files changed
+191
-14
No files matched your search
+14
-1
@@ -6,10 +6,17 @@
|
||||
# home-manager's reloadSystemd is skipped ("User systemd daemon not running"),
|
||||
# so `steamFrameUserServices` does it against the outer session: always
|
||||
# daemon-reload, then start/stop/restart the units in `session.services`.
|
||||
{ config, lib, ... }:
|
||||
# Then `steamFrameRestartCheck` (`install.sh restart-check`) names what the
|
||||
# running session can't pick up (read only at a process start): the keyboard
|
||||
# layout, the SteamVR dashboard patches' DevTools port.
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.steamFrame.session;
|
||||
units = lib.escapeShellArgs;
|
||||
restartCheck = pkgs.callPackage ./cleanup/package.nix {
|
||||
name = "steam-frame-nix-restart-check";
|
||||
command = "restart-check";
|
||||
};
|
||||
rename = from: to: lib.mkRenamedOptionModule ([ "steamFrame" ] ++ from) [ "steamFrame" "session" to ];
|
||||
in {
|
||||
imports = [
|
||||
@@ -91,6 +98,12 @@ in {
|
||||
|
||||
# In a subshell: the outer session's environment must not leak into
|
||||
# activation steps that run later.
|
||||
# Read-only; a warning, never a failed switch.
|
||||
config.home.activation.steamFrameRestartCheck = lib.hm.dag.entryAfter [ "steamFrameUserServices" ] ''
|
||||
STEAM_FRAME_NIX_RUNTIME_DIR=${lib.escapeShellArg cfg.runtimeDir} XDG_CONFIG_HOME=${lib.escapeShellArg config.xdg.configHome} \
|
||||
${lib.getExe restartCheck} || true
|
||||
'';
|
||||
|
||||
config.home.activation.steamFrameUserServices = lib.hm.dag.entryAfter [ "reloadSystemd" ] (''
|
||||
(
|
||||
export XDG_RUNTIME_DIR=${lib.escapeShellArg cfg.runtimeDir} DBUS_SESSION_BUS_ADDRESS=${lib.escapeShellArg cfg.bus}
|
||||
|
||||
Reference in new issue
Block a user