WireGuard: Difference between revisions

Klinger (talk | contribs)
Category:Networking, description and link
Added documentation how to use wg-quick with configFile
Line 236: Line 236:
}
}
</syntaxHighlight>
</syntaxHighlight>
===Client setup (non-declaratively)===
If you have WireGuard configuration files that you want to use as-is (similarly how you would [https://wiki.debian.org/WireGuard#Step_2_-_Configuration configure WireGuard e.g. in Debian], without converting them to a declarative NixOS configuration, you can also configure <code>wg-quick</code> to use them. For example, if you have a configuration file <code>/etc/nixos/wireguard/wg0.conf</code>, add the following line to your <code>configuration.nix</code>:
<syntaxHighlight lang="nix">
networking.wg-quick.interfaces.wg0.configFile = "/etc/nixos/files/wireguard/wg0.conf";
</syntaxHighlight>
This will set up a <code>wg-quick-wg0.service</code> systemd unit.


==Setting up WireGuard with systemd-networkd==
==Setting up WireGuard with systemd-networkd==