flakes/modules/nixos/networking/netbird/default.nix
Chinmay D. Pai 37a10b7fe2
chore: remove unused iproute2 from netbird
Yet another failed experiment to check why netbird fails to connect after
suspending the system. Turns out none of this was needed after all.

All that was needed was to stop systemd from managing foreign routing policy
rules:

systemd.network.config.networkConfig.ManageForeignRoutingPolicyRules = false;

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
2024-09-02 20:48:47 +05:30

28 lines
800 B
Nix

{
config,
lib,
pkgs,
...
}: {
options.snowflake.networking.netbird.enable = lib.mkEnableOption "Enable Netbird VPN client";
config = lib.mkIf config.snowflake.networking.netbird.enable {
networking = {
firewall = {
checkReversePath = "loose";
trustedInterfaces = ["wt0"];
allowedUDPPorts = [config.services.netbird.tunnels.wt0.port];
};
# networkmanager.unmanaged = ["wt0"];
# ref: https://github.com/NixOS/nixpkgs/issues/113589
wireguard.enable = true;
};
services.netbird.enable = true;
# Unmanage the `wt0` interface rules to allow reconnection after suspend.
systemd.network.config.networkConfig.ManageForeignRoutingPolicyRules = lib.mkDefault false;
snowflake.extraPackages = [pkgs.netbird-ui];
};
}