krops-lamassu/README.md
padreug 6febf28955 Initial commit: krops-lamassu deployment template
NixOS deployment template for Lamassu Bitcoin ATM server using
nix-bitcoin and krops.

Features:
- Lamassu server with PostgreSQL and auto-generated secrets
- TLS certificates (self-signed)
- Test VM for local development
- Template structure for easy customization
2026-01-11 23:57:22 +01:00

116 lines
3.1 KiB
Markdown

# krops-lamassu
NixOS deployment template for [Lamassu Bitcoin ATM server](https://github.com/lamassu/lamassu-server) using [nix-bitcoin](https://github.com/fort-nix/nix-bitcoin) and [krops](https://cgit.krebsco.de/krops/).
## Features
- **Lamassu Server** - Bitcoin ATM management system
- **PostgreSQL** - Database with auto-configured credentials
- **TLS Certificates** - Auto-generated self-signed certs
- **Secrets Management** - Automatic generation and secure storage
- **Test VM** - Local testing before production deployment
## Quick Start
1. Clone this repository
2. Copy the example files:
```bash
cp example/krops.nix ./krops.nix
cp -r example/config ./config
```
3. Edit `krops.nix` to set your deployment target
4. Copy hardware config from target: `scp root@node:/etc/nixos/hardware-configuration.nix config/`
5. Edit `config/configuration.nix` to configure services
6. Deploy: `./deploy.sh`
Your `krops.nix` and `config/` are gitignored, so you can pull upstream changes without conflicts.
See [docs/install.md](docs/install.md) for detailed instructions.
## Structure
```
.
├── deploy.sh # Deployment script
├── shell.nix # Development shell
├── docs/
│ └── install.md # Installation guide
├── example/ # Template files (copy to get started)
│ ├── krops.nix # Krops configuration template
│ └── config/
│ ├── configuration.nix # Main NixOS configuration
│ ├── boot.nix # Bootloader config
│ ├── hardware-configuration.nix
│ └── nix-bitcoin-release.nix
├── krops.nix # Your config (gitignored)
├── config/ # Your config (gitignored)
└── secrets/ # Secrets (auto-generated, gitignored)
```
## Usage
```bash
# Deploy to target
./deploy.sh
# Test build (no deploy)
./deploy.sh test
# Run test VM with preconfigured settings
./deploy.sh vm
```
## Test VM
Run a local VM to test your configuration before deploying to production:
1. Edit the VM section in `krops.nix` and replace `127.0.0.1` with your host's IP (e.g., `192.168.1.50`)
2. Run the VM:
```bash
./deploy.sh vm
```
The VM starts with:
- Lamassu server with auto-generated secrets
- PostgreSQL database configured
- Auto-login to root console
Access the admin UI at `https://YOUR-HOST-IP:8443`
Useful commands inside the VM:
```bash
# Watch build progress (first run takes several minutes)
journalctl -fu lamassu-build
# Check service status
systemctl status lamassu-server lamassu-admin-server
# View generated secrets
ls -la /secrets/
```
To exit the VM, run `shutdown now` in the VM console.
## Development Shell
Enter the nix-bitcoin development shell:
```bash
nix-shell
```
## Requirements
- Nix installed on deployment machine
- SSH access to target as root
- NixOS on target machine
## Documentation
- [Installation Guide](docs/install.md)
- [nix-bitcoin docs](https://github.com/fort-nix/nix-bitcoin/tree/master/docs)
- [NixOS manual](https://nixos.org/manual/nixos/stable/)
## License
MIT