setup wireguard on rico2
This commit is contained in:
parent
b6e5604c02
commit
4e249f3a3b
2 changed files with 23 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
{lib, ...}: {
|
{lib, ...}: {
|
||||||
|
imports = [./wireguard.nix];
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "Rico2";
|
hostName = "Rico2";
|
||||||
useDHCP = lib.mkDefault false;
|
useDHCP = lib.mkDefault false;
|
||||||
|
|
22
hosts/rico2/wireguard.nix
Normal file
22
hosts/rico2/wireguard.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
secrets,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (secrets.wireguard_config) peers Proxy Skipper;
|
||||||
|
in {
|
||||||
|
networking.wireguard = {
|
||||||
|
enable = true;
|
||||||
|
interfaces = {
|
||||||
|
wg0 = {
|
||||||
|
inherit (peers."${config.networking.hostName}") ips;
|
||||||
|
privateKeyFile = "/etc/wireguard/private.key";
|
||||||
|
generatePrivateKeyFile = true;
|
||||||
|
peers = [
|
||||||
|
Proxy
|
||||||
|
Skipper
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue