92 lines
2.4 KiB
Nix
92 lines
2.4 KiB
Nix
{ config, lib, pkgs, ... }: {
|
|
|
|
options.sysconfig.opts = {
|
|
|
|
netbird.enable = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
|
|
virtualization.netbird = {
|
|
enable = lib.options.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
};
|
|
};
|
|
};
|
|
|
|
config = {
|
|
|
|
services.netbird = {
|
|
enable = config.sysconfig.opts.netbird.enable;
|
|
};
|
|
|
|
containers.netbird = lib.mkIf config.sysconfig.opts.virtualization.netbird.enable {
|
|
|
|
autoStart = true;
|
|
privateNetwork = true;
|
|
hostAddress = "192.168.100.10";
|
|
localAddress = "192.168.100.21";
|
|
|
|
forwardPorts = [
|
|
|
|
];
|
|
|
|
bindMounts = {
|
|
|
|
};
|
|
|
|
|
|
config = {
|
|
|
|
services.netbird = {
|
|
server = {
|
|
enable = true;
|
|
enableNginx = false;
|
|
domain = "vpn.blunkall.us";
|
|
|
|
management = {
|
|
enable = true;
|
|
|
|
disableAnonymousMetrics = true;
|
|
|
|
dnsDomain = "vpn";
|
|
|
|
oidcConfigEndpoint = "https://auth.blunkall.us/application/o/netbird/.well-known/openid-configuration";
|
|
|
|
settings = {};
|
|
};
|
|
|
|
dashboard = {
|
|
enable = true;
|
|
|
|
settings = {
|
|
AUTH_AUTHORITY = "https://auth.blunkall.us/application/o/netbird/.well-known/openid-configuration";
|
|
};
|
|
};
|
|
|
|
coturn = {
|
|
enable = true;
|
|
|
|
password = "password";
|
|
};
|
|
|
|
signal = {
|
|
enable = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
networking.firewall = {
|
|
allowedTCPPorts = [ 80 443 33073 33080 10000 ];
|
|
allowedUDPPorts = [ 3478 ];
|
|
allowedUDPPortRanges = [{ from = 49152; to = 54152; }];
|
|
};
|
|
|
|
system.stateVersion = "25.05";
|
|
};
|
|
};
|
|
|
|
};
|
|
}
|