Closed apatel762 closed 5 months ago
transferred the issue here from the workstation repo (big jump!)
my idea so far is to keep the wireguard configuration file (managed by chezmoi) somewhere in my home directory, and create a script that can be used to load that configuration file as a new network manager vpn connection config
something like
~/.local/share/chezmoi/home/.chezmoiscripts/run_after_apply.sh
#!/usr/bin/env bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <wireguard-config-file>"
exit 1
fi
CONFIG_FILE=$1
INTERFACE=$(basename "$CONFIG_FILE" .conf)
if nmcli connection show | grep -q "$INTERFACE"; then
echo "Connection for $INTERFACE already exists. Exiting."
exit 0
fi
nmcli connection import type wireguard file "$CONFIG_FILE"
# Verify the connection was added successfully
if nmcli connection show | grep -q "$INTERFACE"; then
echo "WireGuard VPN configuration for $INTERFACE added successfully."
else
echo "Failed to add WireGuard VPN configuration for $INTERFACE."
exit 1
fi
fixed by e827a53bfe163ef38402cd5de555d46472f5f9f9
WireGuard
.conf
files can be stored anywhere/etc/wireguard
but if you use the absolute path to the file when you runwg-quick up /my/vpn.conf
it will know to lookup your file.conf
files contain private keys and therefore can't be stored in version control (unless you want the whole world to be able to connect to your peer).installing mullvad via the .rpm file didn't work for whatever reason, so i want to find a way to manage the vpn connection via wireguard directly (using the config file generator that Mullvad provides)