Add darling-lol --set-prefix to keep the prefix on another drive

The prefix holds the installed clients and game (about 40 GB). The Nix
launcher always exported DPREFIX=${DPREFIX:-~/.darling}, so the prefix saved
in build/config.json was never used and the only way to move it was an
environment variable in every launch context.

- The launcher uses DPREFIX if set, then the saved prefix, then ~/.darling.
- darling-lol --set-prefix PATH runs scripts/nix-prefix.py in the namespace,
  whose root owns the prefix files, so cp -a keeps their owners and xattrs.
  It renames the prefix when possible; across filesystems it copies to
  PATH.partial and removes the old prefix and its overlay work directory
  only after the copy completes. A PATH that already holds a Darling prefix
  is used as it is. It refuses non-empty directories that are not prefixes,
  nested paths and paths with commas or colons (overlayfs separators), then
  saves the path with configure.py --prefix.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
David GhegheaandClaude Opus 5.5 committed 2026-10-18 18:32:14 +02:00
1 parent 78a47d633f
commit 48ae75855f
5 files changed
+220 -2

No files matched your search

+9 -2
View File
@@ -210,8 +210,15 @@ Darling namespace; `darling-lol --stop` can still stop it.
## Files and operational limits
- Workspace: `${XDG_DATA_HOME:-$HOME/.local/share}/darling-lol`.
- Default guest prefix: `$HOME/.darling`; set `DPREFIX` to use another prefix.
Explicit `DPREFIX` and `RIOT_GUEST_HOME` overrides take precedence over saved
- Default guest prefix: `$HOME/.darling`. The prefix holds the installed
clients and game, about 40 GB. To keep it on another drive, close the clients
and run `darling-lol --set-prefix /mnt/games/league`. This moves an existing
prefix there and saves the path for later launches. Across filesystems it
copies first and removes the old prefix only after the copy completes. If the
path already holds a Darling prefix, it switches to it and moves nothing. The
path must not contain commas or colons (overlayfs uses them as separators).
The next launch sets up the runtime in the new prefix.
- Explicit `DPREFIX` and `RIOT_GUEST_HOME` overrides take precedence over saved
configuration, so clear stale overrides before switching installations.
- Package upgrades refresh managed tools and remove previously tracked obsolete
files. Builds, the installed runtime, guest prefixes, and unmanaged files are