feat(hosts/pi4): Added wireguard config
This commit is contained in:
parent
d8304b993d
commit
805e5ee2ae
1 changed files with 33 additions and 1 deletions
|
@ -1,4 +1,8 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
@ -35,4 +39,32 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
# SOPS
|
||||
sops.defaultSopsFile = ../../secrets/pi4/default.yaml;
|
||||
sops.secrets."wireguard/private_key".owner = "root";
|
||||
|
||||
# Wireguard
|
||||
networking.firewall = {
|
||||
allowedUDPPorts = [51820];
|
||||
};
|
||||
networking.wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = ["10.8.0.31/24"];
|
||||
listenPort = 51820; # Should match firewall allowedUDPPorts
|
||||
|
||||
privateKeyFile = config.sops.secrets."wireguard/private_key".path;
|
||||
|
||||
peers = [
|
||||
{
|
||||
publicKey = "KLULII6VEUWMhyIba6oxxHdZsVP3TMVlNY1Vz49q7jg=";
|
||||
|
||||
allowedIPs = ["0.0.0.0/0"];
|
||||
|
||||
endpoint = "vpn.gasdev.fr:993";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue