https://github.com/litarvan/nix-builder
Ready-to-use Nix builder image
https://github.com/litarvan/nix-builder
Last synced: 3 months ago
JSON representation
Ready-to-use Nix builder image
- Host: GitHub
- URL: https://github.com/litarvan/nix-builder
- Owner: Litarvan
- License: mit
- Created: 2023-12-20T04:02:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-26T01:26:05.000Z (about 1 year ago)
- Last Synced: 2025-03-26T02:26:02.264Z (about 1 year ago)
- Language: Dockerfile
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nix Builder Image
This image serves as a Nix remote builder with an automatically started SSH server. You can provide your SSH public keys as arguments.
## Usage
1. **Add SSH Key**: Ensure your SSH key is added using `ssh-add`. Verify that `ssh-add -L` lists your public keys.
2. **Start Container**: Run the container with:
```bash
docker run --rm -dp 22:22 ghcr.io/litarvan/nix-builder:2.27.1 "$(ssh-add -L)"
```
3. **Copy SSH Keys**: Make your SSH keys accessible to the root user:
```bash
sudo cp -r ~/.ssh /var/root
```
4. **Register Builder**: Add the builder to your Nix configuration:
```bash
mkdir -p ~/.config/nix && cat <> ~/.config/nix/nix.conf
builders = ssh://root@127.0.0.1 aarch64-linux
builders-use-substitutes = true
EOF
```
5. **Test Connection**: Verify the setup by testing the SSH connection:
```bash
sudo ssh root@127.0.0.1 nix --version
```
6. **Trusted User**: Ensure you are a trusted user in your Nix installation. Add your username to `~/.config/nix/nix.conf`:
```bash
extra-trusted-users =
```
This setup enables you to use the Nix remote builder effectively.