1
0
Fork 0
Configuration using OpenTofu and Nix
Find a file
2025-02-22 06:01:14 -06:00
modules Create files from nixos-wiki-infra 2025-02-21 05:41:47 -06:00
targets Add headscale 2025-02-22 06:01:14 -06:00
terraform Add headscale 2025-02-22 06:01:14 -06:00
.env.example Add headscale 2025-02-22 06:01:14 -06:00
.gitignore Add headscale 2025-02-22 06:01:14 -06:00
flake.lock Create files from nixos-wiki-infra 2025-02-21 05:41:47 -06:00
flake.nix Add headscale 2025-02-22 06:01:14 -06:00
README.md Add headscale 2025-02-22 06:01:14 -06:00

VPN server configuration

This is an experimental configuration for my Hetzner VPS and Cloudflare to run a VPN using OpenTofu and Nix, based on NixOS/nixos-wiki-infra on Github.

How to use

Copy .env.example to .env and fill in the values.

To generate a token with Hetzner, go to the project and click Security -> API Tokens.

For cross-compiling, you will need to add a builder by visiting the following resources:

Run nix develop at the root of the project directory to access a shell where OpenTofu is accessible.

In the targets directory, run ./apply.sh to update the configurations.

VPN

To set up the VPN, on the VPS run:

headscale users create default
headscale preauthkeys create --user default --reusable

On the client run:

tailscale up --login-server <HEADSCALE_URL> --auth-key <KEY>