Add darwin hosts to wireguard

This commit is contained in:
Yan Lin 2025-09-10 23:02:44 +02:00
parent ae14f058f0
commit 7725fb6846
6 changed files with 68 additions and 1 deletions

View file

@ -0,0 +1,12 @@
[Interface]
# iMac WireGuard Configuration
PrivateKey = AGcWC6Y8e3/FRIGHrg0uwHrILbS7x4hBIDpozZGIf2U=
Address = 10.2.2.40/24
DNS = 1.1.1.1, 8.8.8.8
[Peer]
# VPS Server
PublicKey = 46QHjSzAas5g9Hll1SCEu9tbR5owCxXAy6wGOUoPwUM=
Endpoint = 91.98.84.215:51820
AllowedIPs = 10.2.2.0/24
PersistentKeepalive = 25

12
config/wireguard/mba.conf Normal file
View file

@ -0,0 +1,12 @@
[Interface]
# MacBook Air WireGuard Configuration
PrivateKey = eOmRh2Mrb9+xmbFtHtuOxlRM09ZLKOVWeoEQJk07bVo=
Address = 10.2.2.41/24
DNS = 1.1.1.1, 8.8.8.8
[Peer]
# VPS Server
PublicKey = 46QHjSzAas5g9Hll1SCEu9tbR5owCxXAy6wGOUoPwUM=
Endpoint = 91.98.84.215:51820
AllowedIPs = 10.2.2.0/24
PersistentKeepalive = 25

View file

@ -9,4 +9,20 @@
imports = [
../system-default.nix
];
# WireGuard LaunchAgent for auto-start
launchd.user.agents.wireguard = {
serviceConfig = {
ProgramArguments = [
"/opt/homebrew/bin/wg-quick"
"up"
"/Users/yanlin/.config/nix/config/wireguard/imac.conf"
];
RunAtLoad = true;
KeepAlive = false;
Label = "com.wireguard.imac";
StandardErrorPath = "/tmp/wireguard.err";
StandardOutPath = "/tmp/wireguard.out";
};
};
}

View file

@ -9,4 +9,20 @@
imports = [
../system-default.nix
];
# WireGuard LaunchAgent for auto-start
launchd.user.agents.wireguard = {
serviceConfig = {
ProgramArguments = [
"/opt/homebrew/bin/wg-quick"
"up"
"/Users/yanlin/.config/nix/config/wireguard/mba.conf"
];
RunAtLoad = true;
KeepAlive = false;
Label = "com.wireguard.mba";
StandardErrorPath = "/tmp/wireguard.err";
StandardOutPath = "/tmp/wireguard.out";
};
};
}

View file

@ -158,6 +158,16 @@
publicKey = "f/+Jyz4CpD5uyaZox77IuD9mI/KU9QOiK6tLMcbVGTE=";
allowedIPs = [ "10.2.2.31/32" ];
}
{
name = "imac";
publicKey = "MVpIxA7HOjTCAsyI/IXK4lo0B2OM9BCHzUelUyAqT20=";
allowedIPs = [ "10.2.2.40/32" ];
}
{
name = "mba";
publicKey = "NeaCT4v6eUzHkRhm5YcKnB4W8KXBCZNedoBlLM5zMQQ=";
allowedIPs = [ "10.2.2.41/32" ];
}
];
};
};

View file

@ -11,7 +11,8 @@
};
brews = [
# Command-line tools go here
# Example: "wget"
"wireguard-go"
"wireguard-tools"
];
casks = [
# GUI applications - manually installed apps now managed by Homebrew