nixpkgs/nixos/tests/wireguard/make-peer.nix
Sizhe Zhao ef29596a75
nixosTests.wireguard: handleTest -> runTest
(cherry picked from commit 71d0e1c8b5ffc0a4e8b6a85ce85b1a32d2dbcf8a)
2025-07-23 16:33:29 +08:00

34 lines
577 B
Nix

{
ip4,
ip6,
extraConfig,
}:
{
imports = [
{
boot.kernel.sysctl = {
"net.ipv6.conf.all.forwarding" = "1";
"net.ipv6.conf.default.forwarding" = "1";
"net.ipv4.ip_forward" = "1";
};
networking.useDHCP = false;
networking.interfaces.eth1 = {
ipv4.addresses = [
{
address = ip4;
prefixLength = 24;
}
];
ipv6.addresses = [
{
address = ip6;
prefixLength = 64;
}
];
};
}
extraConfig
];
}