aboutsummaryrefslogtreecommitdiff
path: root/deploy_wg
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-10-16 11:58:11 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-10-16 11:58:11 +0200
commitd442b9a068b39e0180027398faa7011bbbe3c3c9 (patch)
tree011c2bd709002ceca5881b8c383ebbe81c4b5c02 /deploy_wg
parent9a8cbf91215317a571ed3714f76230a751a91896 (diff)
downloadnixcfg-d442b9a068b39e0180027398faa7011bbbe3c3c9.tar.gz
nixcfg-d442b9a068b39e0180027398faa7011bbbe3c3c9.zip
Update README
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)"'