summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-06-22 23:44:40 +0200
committerAdrian Kummerlaender2019-06-22 23:45:11 +0200
commite481d7b2962e1e5dbe9a4ca10bfef91ba6c266f5 (patch)
treee7c048d0709f219eb5e9cf5e0d2ef45a2339aa16
parent9d32f1e1a37a063b6d1fa8924e4022fd2581f3be (diff)
downloadnixos_system-e481d7b2962e1e5dbe9a4ca10bfef91ba6c266f5.tar
nixos_system-e481d7b2962e1e5dbe9a4ca10bfef91ba6c266f5.tar.gz
nixos_system-e481d7b2962e1e5dbe9a4ca10bfef91ba6c266f5.tar.bz2
nixos_system-e481d7b2962e1e5dbe9a4ca10bfef91ba6c266f5.tar.xz
nixos_system-e481d7b2962e1e5dbe9a4ca10bfef91ba6c266f5.zip
Add basic wireguard setup
-rw-r--r--host/automatix.nix1
-rw-r--r--host/software/server/wireguard.nix26
2 files changed, 27 insertions, 0 deletions
diff --git a/host/automatix.nix b/host/automatix.nix
index 9967430..d95f12e 100644
--- a/host/automatix.nix
+++ b/host/automatix.nix
@@ -7,6 +7,7 @@
./software/server/git.nix
./software/server/mail.nix
./software/server/website.nix
+ ./software/server/wireguard.nix
];
boot.loader.grub = {
diff --git a/host/software/server/wireguard.nix b/host/software/server/wireguard.nix
new file mode 100644
index 0000000..3b48315
--- /dev/null
+++ b/host/software/server/wireguard.nix
@@ -0,0 +1,26 @@
+{
+ networking.firewall = {
+ allowedUDPPorts = [ 54321 ];
+ };
+
+ networking.wireguard.interfaces = {
+ wg0 = {
+ ips = [ "10.100.0.1/24" ];
+
+ listenPort = 54321;
+
+ privateKeyFile = "/etc/wireguard/private";
+
+ peers = [
+ { # obelix
+ publicKey = "RrsNZKZ17Ol1WHxZesLnenGKnqxiQlE0T8xFP6/5mBE=";
+ allowedIPs = [ "10.100.0.2/32" ];
+ }
+ { # majestix
+ publicKey = "Tkoaewh9HB5rIuJVrFgClRF4x7prOtIlSJjiTYCpxis=";
+ allowedIPs = [ "10.100.0.3/32" ];
+ }
+ ];
+ };
+ };
+}