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

@ -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" ];
}
];
};
};