You s
8000
igned in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
huggorm: a server in its own user namespace over an overlay store #1060
pynix build --namespaced runs on nanopynix's worker in a user namespace (#1051). User chose (2026-10-24) that huggorm owns this: the server enters the namespace, and pynix connects to it.
Design:
huggorm.namespace (stdlib only): the overlay layout (upper, work, state, log under one root; lower-store, lower-dir), its local-overlay:// URI (lower-store, upper-layer, state, log from local-overlay-store.hh 2.34), and enter_overlay_namespace (unshare USER|NS, uid/gid map to 0, / rprivate, overlay userxattr). Ported from nanopynix/namespace.py, without pydantic.
huggorm.server --overlay ROOT [--lower-store URI --lower-dir DIR]: enters the namespace in main(), before anyio.run. It enables local-overlay-store and sets build-users-group = "" and require-drop-supplementary-groups = false.
--load-config: the server reads no nix.conf today. nanopynix's worker did, and sandbox-paths and NIX_CONFIG depend on it.
AsyncRemoteSession gains forward, forward_process and capture_process, as the local session has.
Measured: one OS thread (/proc/self/task) after import huggorm_bindings and import huggorm.server. So main() can unshare with no exec.
No forkserver probe: the server is a subprocess, and its stderr carries the reason it failed.
Server half measured (huggorm.namespace, huggorm.server --overlay ROOT --load-config). A build in the overlay lands in ROOT/upper and not in /nix/store (tests/test_namespace.py, nix_2_35 lane).
The settings that --overlay forces. Each was proven by overriding it with --option with the host's nix.conf loaded:
setting
error when broken
build-users-group = ""
changing ownership of "/nix/store": Invalid argument
require-drop-supplementary-groups = false
setgroups failed
auto-optimise-store = false
hard link from /nix/store/.links/...: Permission denied
auto-allocate-uids = false
opening user lock "/nix/var/nix/userpool2/slot-0": Permission denied
nanopynix set only the first two. The other three come from this host's nix.conf, which the server reads only with --load-config.
A lower layer other than the host store hides the server's own closure. The server then fails its first lazy import: No module named 'anyio._backends'. So --lower-dir must hold the server's closure.
The nix_2_34 lane cannot build over this host's 2.35.3 daemon: QueryRealisation is refused (#1061). The test skips there and gives that reason.
pynix half measured (pynix/tests/test_build_namespaced.py, Nix 2.35 dev shell: 3 passed):
The output stays in ROOT/upper, and the host store has no copy with --no-copy-back.
nix.conf's /bin/sh and a --sandbox-path are both mounted. With sandbox-paths in place of extra-sandbox-paths, the builder fails ("builder failed with exit code 1").
--copy-back is the default, and the output reaches the daemon.
A failed build raises Nix's BuildError itself. Before the NixClient.__aexit__ fix it arrived in the ping loop's ExceptionGroup.
Found on the way and fixed: python -m huggorm.server printed a runpy RuntimeWarning on every start, into pynix's stderr. spawned() uses -c (#1062 holds the -m entry).
On the default 2.34 shell the three tests skip: #1061.
Remaining: remove pynix's other nanopynix pieces (target.py engine parts, the _util sessions, main.py's NixError).
Activity
Lillecarl commentedon Oct 24, 2026
Server half measured (
huggorm.namespace,huggorm.server --overlay ROOT --load-config). A build in the overlay lands inROOT/upperand not in/nix/store(tests/test_namespace.py,nix_2_35lane).The settings that
--overlayforces. Each was proven by overriding it with--optionwith the host's nix.conf loaded:build-users-group = ""changing ownership of "/nix/store": Invalid argumentrequire-drop-supplementary-groups = falsesetgroups failedauto-optimise-store = false/nix/store/.links/...:Permission deniedauto-allocate-uids = falseopening user lock "/nix/var/nix/userpool2/slot-0": Permission denieduse-cgroups = falsecreating cgroup ".../nix-build-pid-...": Permission deniednanopynix set only the first two. The other three come from this host's nix.conf, which the server reads only with
--load-config.A lower layer other than the host store hides the server's own closure. The server then fails its first lazy import:
No module named 'anyio._backends'. So--lower-dirmust hold the server's closure.The
nix_2_34lane cannot build over this host's 2.35.3 daemon: QueryRealisation is refused (#1061). The test skips there and gives that reason.Assisted-By: Claude Opus 5.5
Lillecarl commentedon Oct 24, 2026
pynix half measured (
pynix/tests/test_build_namespaced.py, Nix 2.35 dev shell: 3 passed):ROOT/upper, and the host store has no copy with--no-copy-back./bin/shand a--sandbox-pathare both mounted. Withsandbox-pathsin place ofextra-sandbox-paths, the builder fails ("builder failed with exit code 1").--copy-backis the default, and the output reaches the daemon.BuildErroritself. Before theNixClient.__aexit__fix it arrived in the ping loop's ExceptionGroup.Found on the way and fixed:
python -m huggorm.serverprinted a runpy RuntimeWarning on every start, into pynix's stderr.spawned()uses-c(#1062 holds the-mentry).On the default 2.34 shell the three tests skip: #1061.
Remaining: remove pynix's other nanopynix pieces (target.py engine parts, the
_utilsessions, main.py's NixError).Assisted-By: Claude Opus 5.5
feat(huggorm): a server in its own user namespace over an overlay store
feat(huggorm): a remote session forwards and captures as a local one
feat(huggorm): spawn a server and wait until it listens
fix(huggorm): a block's error leaves a remote client as itself
fix(huggorm): a spawned server writes nothing to stderr
feat(pynix): build --namespaced on a huggorm server
feat(huggorm)!: init_plugins says whether it loaded, and a second cal…
refactor(pynix): drop the nanopynix sessions and their log forwarder
refactor(pynix): target.py keeps no evaluator code
refactor(pynix): main reports huggorm's NixError alone, and names no …
refactor(pynix): build strips colour with huggorm, not nanopynix
docs(pynix): comments name huggorm where they named nanopynix's engine
fix(pynix): beartype decorates copy_verified and the REPL log forwarder
test(pynix): rename test_verbosity to test_verbosity_of
fix(pynix): tests keep the host nix.conf out through pynix's own guard
feat(huggorm): a server in its own user namespace over an overlay store
feat(huggorm): a remote session forwards and captures as a local one
feat(huggorm): spawn a server and wait until it listens
fix(huggorm): a block's error leaves a remote client as itself
fix(huggorm): a spawned server writes nothing to stderr
feat(huggorm)!: init_plugins says whether it loaded, and a second cal…
feat(pynix): build --namespaced on a huggorm server