mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-05-18 18:36:05 -07:00
fix wireguard setup
This commit is contained in:
parent
856352f045
commit
86d4170178
@ -64,7 +64,7 @@
|
||||
terminal.enable = true;
|
||||
wireguard-client = {
|
||||
enable = true;
|
||||
privateKeyFile = "/run/agenix/wireguard/kestrel";
|
||||
host = "kestrel";
|
||||
address = [ "192.168.3.3/24" ];
|
||||
publicKey = "bd7bbZOngl/FTdBlnbIhgCLNf6yx5X8WjiRB7E1NEQQ=";
|
||||
endpoint = "66.218.43.87";
|
||||
|
@ -51,8 +51,8 @@
|
||||
terminal.enable = true;
|
||||
wireguard-client = {
|
||||
enable = true;
|
||||
privateKeyFile = "/run/agenix/wireguard/osprey";
|
||||
address = [ "192.168.3.3/24" ];
|
||||
host = "osprey";
|
||||
address = [ "192.168.3.5/24" ];
|
||||
publicKey = "bd7bbZOngl/FTdBlnbIhgCLNf6yx5X8WjiRB7E1NEQQ=";
|
||||
endpoint = "66.218.43.87";
|
||||
};
|
||||
|
@ -5,7 +5,7 @@ let cfg = config.modules.system.wireguard-client;
|
||||
in {
|
||||
options.modules.system.wireguard-client = with lib; {
|
||||
enable = lib.mkEnableOption "wireguard-client";
|
||||
privateKeyFile = lib.mkOption { type = with types; str; };
|
||||
host = lib.mkOption { type = with types; str; };
|
||||
address = lib.mkOption { type = with types; listOf str; };
|
||||
publicKey = lib.mkOption { type = with types; str; };
|
||||
endpoint = lib.mkOption { type = with types; str; };
|
||||
@ -24,11 +24,13 @@ in {
|
||||
networking.firewall = {
|
||||
allowedUDPPorts = [ 51820 ];
|
||||
};
|
||||
# deploy needed secrets
|
||||
age.secrets."wireguard/${cfg.host}".file = ../../secrets/wireguard/${cfg.host}.age;
|
||||
networking.wg-quick.interfaces = {
|
||||
wg0 = {
|
||||
address = cfg.address;
|
||||
listenPort = 51820;
|
||||
privateKeyFile = cfg.privateKeyFile;
|
||||
privateKeyFile = "/run/agenix/wireguard/${cfg.host}";
|
||||
autostart = cfg.autostart;
|
||||
peers = [{
|
||||
publicKey = cfg.publicKey;
|
||||
|
Loading…
x
Reference in New Issue
Block a user