Skip to main content

Files HexBox manages

HexBox keeps its files in ~/.local/state/hb. Every switch rewrites the scripts and SSH configuration there from your Nix configuration, so don't edit them by hand; change your configuration instead.

Keys​

The first switch creates these, and later switches never overwrite them:

FileWhat it is
builder_ed25519, builder_ed25519.pubThe key Nix logs in to the builder with
ssh_host_ed25519_key, ssh_host_ed25519_key.pubThe builder's own host key
known_hostsLets SSH check it's talking to your builder

Deleting the keys locks your Mac out of the builder. If you need new keys, delete them, switch again to create new ones, and then run hb builder reset, so the machine is recreated with the new keys.

Scripts​

FileWhat it does
bootstrap-keys.shCreates any missing keys above; each switch runs it
start-container.shStarts the builder, creating or updating it as needed
stop-container.shStops the builder
reset-container.shDeletes the builder and creates a fresh one
bootstrap-machine.shSets up a new machine (used by start-container.sh)
proxy.shThe SSH ProxyCommand described in How Nix reaches the builder
ssh-wrapper.shRuns SSH with HexBox's configuration
reconcile-host-container-internal.shCreates or removes the host.container.internal name

Configuration and state​

FileWhat it is
ssh_config, ssh_config_rootSSH settings for the two builder host names
machine-generationWhich image the current machine was built from; a mismatch makes HexBox recreate it
hexbox-readiness.logWhat hb builder repair and hb builder reset saw while waiting for SSH
builder-image/ContainerfileA copy of your Containerfile, if you set imageContainerfile

Elsewhere​

  • /usr/local/bin/hb is the hb helper.
  • /etc/ssh/ssh_config.d/201-container-builder.conf makes ssh nix-builder work from any terminal, and lets the Nix daemon find the builder.