aboutsummaryrefslogtreecommitdiff
path: root/deploy_wg
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-10-16 12:08:49 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-10-16 12:08:49 +0200
commitb42bf16f78b2f9b0e53cf5bd5a9bc396b9286ec1 (patch)
treeeb822c16e53f4b5a5cf90984ab434b62a64241a1 /deploy_wg
parent294c2ad2ed46d12ac7b8305bb2b67b460c134180 (diff)
parent45a0e850ce7c498e5ef1d281fb67b2f34dc00e8c (diff)
downloadnixcfg-b42bf16f78b2f9b0e53cf5bd5a9bc396b9286ec1.tar.gz
nixcfg-b42bf16f78b2f9b0e53cf5bd5a9bc396b9286ec1.zip
Merge branch 'main' into add-bespin
Diffstat (limited to 'deploy_wg')
-rwxr-xr-xdeploy_wg6
1 files changed, 6 insertions, 0 deletions
diff --git a/deploy_wg b/deploy_wg
new file mode 100755
index 0000000..ba67b2e
--- /dev/null
+++ b/deploy_wg
@@ -0,0 +1,6 @@
+#!/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)"'