nixcfg/deploy_wg
2022-10-16 11:58:11 +02:00

6 lines
357 B
Text
Executable file

#!/usr/bin/env ./sshtool
cmd 'nix-env -i wireguard'
cmd 'mkdir -p /var/lib/deuxfleurs/wireguard-keys'
cmd 'test -f /var/lib/deuxfleurs/wireguard-keys/private || (wg genkey > /var/lib/deuxfleurs/wireguard-keys/private; chmod 600 /var/lib/deuxfleurs/wireguard-keys/private)'
cmd 'echo "Public key: $(wg pubkey < /var/lib/deuxfleurs/wireguard-keys/private)"'