Repository navigation
Harden Steam sharing; bees for btrfs gaming machines, paused while gaming - #37
Open
andrewthomaslee wants to merge 1 commit into
Open
andrewthomaslee wants to merge 1 commit into
andrewthomaslee wants to merge 1 commit into
Conversation
…ming
steam-copy-game and steam-shader-sync run as root over folders users
control. Validate a game's installdir (a "../" path made root copy and,
with --force, remove system paths), use only the Steam folder and
<libraryRoot>/<user> as libraries, run both in a ProtectSystem=strict
sandbox, and let the receiving user do every replace and delete. Skip
users whose steam-config-patcher is writing config.vdf, keep duplicate
keys and a backup when rewriting it, and only share a shader cache
within one build of a game.
gaming.dedup turns bees on for the root filesystem of btrfs gaming
machines and freezes it while a Steam game runs: the idle I/O class does
nothing on NVMe ("none" scheduler). btrfs-dedup caps bees' memory with
MemoryHigh (its page cache pushed games into swap) and turns on a
monthly scrub. steamSharing.libraryRoot (default /srv/steam/users)
gets per-user libraries from tmpfiles. Docs: a Gaming page.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 11, 2026
kamrui-h1: reinstall layout with hibernation, /srv/steam and k3s subvolumes
external-systems/home#43
Draft
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hardens Steam sharing (root-run scripts in users' folders), moves bees into the gaming module for every btrfs gaming machine, and keeps bees out of a running game's way.
Docs: new Gaming page (
documentation/docs/gaming.md, in the nav), README consumer note.Evidence
nix flake check(incl.eval-all-enabledwithgaming.dedup.enable): passes.vm-test steam-sharing: passes, with new subtests:a game folder that is a path is refused: manifestinstalldir = ../../../../../../../etc/secret→steam-copy-game --forcefails,/etc/secret/keyuntouched, nothing in bob's library.libraries outside libraryRoot are ignored: game listed only in/mnt/steam/elsewhere→ "has no installed game 700".steam-copy-game waits for steam-config-patcher,shader sync only shares within one build of a game, sandbox (ProtectSystem=strict) and tmpfiles-made libraries (<user>:700).vm-test btrfs-dedup(local KVM): passes. New subtests:MemoryHigh= 3 GiB,btrfs-scrub@mnt-dedup.timerenabled,bees is frozen while a Steam game runs(log:a game is running: beesd@root.service paused…resumed10 s after the fakereaper SteamLaunch AppId=100exits),stopping the pause service never leaves bees frozen.main. Run this test locally.Before (live kamrui-h1): bees cgroup 24 GB page cache, zram swapping 1.5 GB; NVMe scheduler
noneignores bees' idle I/O class.Merge Danger
Door: two-way
Revert restores the old scripts and options.
libraryRootdefault/srv/steam/usersmakes tmpfiles create that folder on every steamSharing machine; existing libraries elsewhere (kamrui-h1's/mnt/steam/users/<user>) stop being used by the sharing tools until the machine moves to/srv/steam(external-systems/home, draft PR) or setslibraryRoot.Blast Radius: gaming-machines
bees turns on by default for
nixostoo (btrfs root, gaming tag): 512 MB locked hash table, 3 GB memory ceiling, monthly scrub. Opt out per machine withhostSpec.system.gaming.dedup.enable = false.Merge order: this first; the external-systems/home PR (draft) bumps
modulesafter it merges. Do not merge until the owner approves.🤖 Generated with Claude Code