New scripts/configure-nix-cache-client.sh: the non-NixOS equivalent of modules/nix-cache/client.nix/remote-builder-client.nix -- run as root on a plain Debian machine with the Nix package manager installed to add nix-cache as a substituter in /etc/nix/nix.conf (via extra-substituters/extra-trusted-public-keys, layering on top of existing config instead of clobbering it), with https://cache.nixos.org/ kept as fallback if nix-cache is unreachable. If /root/.ssh/nixremote is already installed, also configures it as a distributed-build machine and trusts nix-cache's SSH host key. Idempotent (marker-block replace on re-run).
Wired into scripts/create-proxmox-resource.sh: the first time it bootstraps Nix tooling on a fresh Proxmox node (not on every run, and not inside codex-setup.sh/codex-maintenance.sh themselves), it now also runs this script there, non-fatally, so the node substitutes from / can offload builds to nix-cache on every subsequent run.
CLAUDE.md updated to document both.
Test plan
bash -n on both changed/new scripts
Exercised configure-nix-cache-client.sh against a scratch /etc-style dir: no-remote-builder-key path, full remote-builder path, and a second run to confirm the marker block replaces in place rather than duplicating (nix.conf block + known_hosts line both stayed single-copy)
Not run against a real Debian/Proxmox host (needs operator's own SSH/root access per repo safety rules)
## Summary
- New `scripts/configure-nix-cache-client.sh`: the non-NixOS equivalent of `modules/nix-cache/client.nix`/`remote-builder-client.nix` -- run as root on a plain Debian machine with the Nix package manager installed to add nix-cache as a substituter in `/etc/nix/nix.conf` (via `extra-substituters`/`extra-trusted-public-keys`, layering on top of existing config instead of clobbering it), with `https://cache.nixos.org/` kept as fallback if nix-cache is unreachable. If `/root/.ssh/nixremote` is already installed, also configures it as a distributed-build machine and trusts nix-cache's SSH host key. Idempotent (marker-block replace on re-run).
- Wired into `scripts/create-proxmox-resource.sh`: the first time it bootstraps Nix tooling on a fresh Proxmox node (not on every run, and not inside `codex-setup.sh`/`codex-maintenance.sh` themselves), it now also runs this script there, non-fatally, so the node substitutes from / can offload builds to nix-cache on every subsequent run.
- CLAUDE.md updated to document both.
## Test plan
- [x] `bash -n` on both changed/new scripts
- [x] Exercised `configure-nix-cache-client.sh` against a scratch `/etc`-style dir: no-remote-builder-key path, full remote-builder path, and a second run to confirm the marker block replaces in place rather than duplicating (nix.conf block + known_hosts line both stayed single-copy)
- [ ] Not run against a real Debian/Proxmox host (needs operator's own SSH/root access per repo safety rules)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Non-NixOS machines with just the Nix package manager installed have no
module system to pick up modules/nix-cache/client.nix, so this edits
/etc/nix/nix.conf directly (extra-substituters/extra-trusted-public-keys,
plus the SSH remote-builder config once the nixremote key is installed),
falling back to cache.nixos.org when nix-cache is unreachable.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Run it once, right after a node's first-time Nix bootstrap (not on every
invocation, and not inside codex-setup.sh/codex-maintenance.sh themselves),
so a freshly-bootstrapped Proxmox node substitutes from and can offload
builds to nix-cache on every subsequent run. Non-fatal on failure -- the
build still proceeds, just without nix-cache.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
beatzaplenty
marked the pull request as work in progress 2026-07-20 15:13:52 +00:00
beatzaplenty
marked the pull request as ready for review 2026-07-20 15:14:43 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
scripts/configure-nix-cache-client.sh: the non-NixOS equivalent ofmodules/nix-cache/client.nix/remote-builder-client.nix-- run as root on a plain Debian machine with the Nix package manager installed to add nix-cache as a substituter in/etc/nix/nix.conf(viaextra-substituters/extra-trusted-public-keys, layering on top of existing config instead of clobbering it), withhttps://cache.nixos.org/kept as fallback if nix-cache is unreachable. If/root/.ssh/nixremoteis already installed, also configures it as a distributed-build machine and trusts nix-cache's SSH host key. Idempotent (marker-block replace on re-run).scripts/create-proxmox-resource.sh: the first time it bootstraps Nix tooling on a fresh Proxmox node (not on every run, and not insidecodex-setup.sh/codex-maintenance.shthemselves), it now also runs this script there, non-fatally, so the node substitutes from / can offload builds to nix-cache on every subsequent run.Test plan
bash -non both changed/new scriptsconfigure-nix-cache-client.shagainst a scratch/etc-style dir: no-remote-builder-key path, full remote-builder path, and a second run to confirm the marker block replaces in place rather than duplicating (nix.conf block + known_hosts line both stayed single-copy)🤖 Generated with Claude Code