This image serves as a Nix remote builder with an automatically started SSH server. You can provide your SSH public keys as arguments.
-
Add SSH Key: Ensure your SSH key is added using
ssh-add
. Verify thatssh-add -L
lists your public keys. -
Start Container: Run the container with:
docker run --rm -dp 22:22 ghcr.io/litarvan/nix-builder:2.27.1 "$(ssh-add -L)"
-
Copy SSH Keys: Make your SSH keys accessible to the root user:
sudo cp -r ~/.ssh /var/root
-
Register Builder: Add the builder to your Nix configuration:
mkdir -p ~/.config/nix && cat <<EOF >> ~/.config/nix/nix.conf builders = ssh://root@127.0.0.1 aarch64-linux builders-use-substitutes = true EOF
-
Test Connection: Verify the setup by testing the SSH connection:
sudo ssh root@127.0.0.1 nix --version
-
Trusted User: Ensure you are a trusted user in your Nix installation. Add your username to
~/.config/nix/nix.conf
:extra-trusted-users = <your-username>
This setup enables you to use the Nix remote builder effectively.