# NixOS builds and LAN cache `builder` is the headless configuration for the VM at `10.17.1.100`. Woodpecker builds every `nixosConfigurations` toplevel on pushes and manual runs. Builds run sequentially with one Nix job and four cores on this 8 GiB VM. Secrix runtime secrets do not need decryption in CI. ## Finish Woodpecker registration 1. Create an agent in Woodpecker and restrict its server-side filters to `repo=CaZzzer/nix-conf` (use the repository's exact spelling as displayed by Woodpecker). Allow only trusted users to push or change pipelines. The local backend executes repository commands as the `woodpecker` user on the VM. 2. On the VM, use `sudo install -m 0600 /dev/null /var/lib/woodpecker/agent.env` once, then `sudoedit /var/lib/woodpecker/agent.env` and enter: ```ini WOODPECKER_AGENT_SECRET= WOODPECKER_SERVER= WOODPECKER_GRPC_SECURE=true WOODPECKER_GRPC_SKIP_VERIFY=false ``` Use `WOODPECKER_GRPC_SECURE=false` for a private plaintext gRPC listener. The public web UI address does not necessarily expose gRPC. The default in the module is `woodpecker.cazzzer.com:9000`; override it here as needed. 3. Run `sudo systemctl start woodpecker-agent-nix`. 4. Enable this repository in Woodpecker. Add a repository secret named `transcrypt_password` containing the existing transcrypt password. Limit it to push/manual events; do not enable it for pull requests. Commit and push these changes, then confirm the agent picks up the workflow. The pipeline explicitly uses the native `woodpecker-plugin-git` clone binary. It initializes transcrypt with `aes-256-cbc`, suppressing its credential output. No secret values belong in Nix expressions or the repository. ## Cache `nix-serve-ng` serves the VM's persistent store at `http://10.17.1.100:5000` through the NixOS `nix-serve` service. It signs responses using `/var/lib/nix-cache/cache-key.sec` (root-only). Back up this key securely; its public key is configured in `hosts/common.nix`. Rebuilding each client once installs cache trust. Clients need LAN/VPN access to this address; the official NixOS cache remains configured. Successful builds leave indirect GC roots at `/var/lib/nix-ci/`, retaining the latest successful closure per host. Weekly GC removes unrooted paths older than 14 days. Monitor disk space: 100 GiB may become tight for desktop closures and intermediate builds. Remove roots for retired hosts deliberately. The cache is intended for a trusted LAN. Transcrypt plaintext can occur in Nix store sources and generated configuration, so readers of the cache may recover that information. Runtime secrix secrets remain encrypted. Do not expose this endpoint publicly without adding access control. ## Updating the builder Build `.#nixosConfigurations.builder.config.system.build.toplevel`, copy its closure to the VM and activate it, or use `nixos-rebuild` targeting `builder`. New repository files must be added to Git before a Git-flake build sees them; `path:.` can be used when validating an uncommitted working tree. Check services with: ```sh systemctl status woodpecker-agent-nix nix-serve journalctl -u woodpecker-agent-nix -f curl http://10.17.1.100:5000/nix-cache-info ```