Skip to content

Commit

Permalink
modules/steam: Add workarounds for OOBE
Browse files Browse the repository at this point in the history
The steam updater will otherwise attempt to update even though there is
no network connection.

So we'll use approximately the vendor methods to decide what to do here.
  • Loading branch information
samueldr committed Aug 22, 2023
1 parent 97662e4 commit 9fed4c4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions modules/steam/steam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let
mangohud
bubblewrap
systemd
networkmanager

jupiter-hw-support
steamdeck-hw-theme
Expand Down Expand Up @@ -48,6 +49,7 @@ let
sessionPath = makeBinPath [
mangohud
systemd
networkmanager
steam
steam.run
];
Expand Down Expand Up @@ -146,6 +148,34 @@ let
set -e
# OOBE handling.
# (See steam-jupiter.sh in steam-jupiter-oobe and steam-jupiter-stable)
# On first boot, we need to start whatever steam we have packaged, to
# allow the user to connect to the internet. We don't have the luxury
# that Steam's OOBE has to be heavy-handed. So instead we'll see if it
# looks like the user has never started steam. If it looks that way,
# we'll init OOBE, and otherwise undo it.
(
STEAM_LINKS="$HOME"/.steam
STEAM_DIR="$HOME"/.local/share/Steam
REGISTRY="$STEAM_LINKS"/registry.vdf
echo ":: Checking if we're offline, or in OOBE..."
if ! test -f "$REGISTRY" || [[ "$(nmcli networking connectivity check)" != full ]]; then
echo " We are!!"
echo " Disabling the updater..."
mkdir -pv "$STEAM_DIR"
printf '# OOBE Inhibit\nBootStrapperInhibitAll = enable' \
> "$STEAM_DIR"/Steam.cfg
else
echo " We are not"
if grep '^# OOBE Inhibit' "$STEAM_DIR"/Steam.cfg; then
echo " Deleting our own OOBE config."
rm -v "$STEAM_DIR"/Steam.cfg
fi
fi
)
steam -steamos3 -steampal -steamdeck -gamepadui "$@" &
wait
'';
Expand Down

0 comments on commit 9fed4c4

Please sign in to comment.