enable wireguard

This commit is contained in:
stubbfelnewpc
2020-10-29 00:01:15 +01:00
parent 40ae08c3c9
commit 836033ef1f
2 changed files with 17 additions and 24 deletions

View File

@@ -14,7 +14,7 @@
./sks.nix ./sks.nix
./gitea.nix ./gitea.nix
./nexus.nix ./nexus.nix
#./wireguard.nix ./wireguard.nix
#./mqtt.nix #./mqtt.nix
]; ];
} }

View File

@@ -1,27 +1,20 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
{ {
boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ]; boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
environment.systemPackages = [ pkgs.wireguard ]; environment.systemPackages = [ pkgs.wireguard ];
networking.firewall.allowedTCPPorts = [ 51820 ]; networking.firewall.allowedTCPPorts = [ 51820 ];
networking.firewall.allowedUDPPorts = [ 51820 ]; networking.firewall.allowedUDPPorts = [ 51820 ];
networking.wireguard.interfaces.wg0 = { networking.wireguard.interfaces.wg0 = {
listenPort = 51820; listenPort = 51820;
privateKeyFile = "/etc/nixos/services/wg0.key"; privateKeyFile = "/etc/nixos/services/wg0.key";
ips = [ "192.168.43.1/24" ]; ips = [ "192.168.43.1/24" ];
peers = [ peers = [
{ {
allowedIPs = ["192.168.43.2"]; allowedIPs = ["192.168.43.2"];
publicKey = "vGuxJHw7I1gSQd7SThDu758ynR3AKVXjgqtNIUnMBEg="; publicKey = "wbeCSyurE/kiXooaqieRgoDHJiDBiw/CHvF5e+LCPlw=";
persistentKeepalive = 25; persistentKeepalive = 25;
} }
];
{ };
allowedIPs = ["192.168.43.3"];
publicKey = "YQ/SN8ZauuvWKJp+cT2JPP7sUUJai4ujubAZNZkZAAU=";
persistentKeepalive = 25;
}
];
};
} }