Try tailscale

This commit is contained in:
Invariantspace 2023-11-27 21:44:04 -08:00
parent aa79162e2c
commit a2e5f43a1f
17 changed files with 50 additions and 80 deletions

View file

@ -1,34 +1,13 @@
{ config, ... }:
let hn = config.networking.hostName; port = config.constants.port; wgi = "wgs"; in {
let hn = config.networking.hostName; in {
networking = {
domain = config.constants.domain;
firewall = {
allowedTCPPorts = with port; [ http https xray ];
allowedUDPPorts = with port; [ wireguard-server ];
allowedTCPPorts = with config.constants.port; [ http https ];
};
hostId = "2cadb253";
nat = {
enable = true;
externalInterface = "ens18";
internalInterfaces = [ wgi ];
};
nftables.enable = true;
wireguard.interfaces.${wgi} = {
ips = [ "10.32.54.76/24" ];
listenPort = port.wireguard-server;
peers = [
{
allowedIPs = [ "10.32.54.2/32" ];
publicKey = "RhS1H8g47EnOhu1F6y3QO6XqxnabGcNNb0BixBuKkDQ=";
}
{
allowedIPs = [ "10.32.54.3/32" ];
publicKey = "1OA03mqu7SxREAum4UabJKD7hf+foPLu1j0E1N5K508=";
}
];
privateKeyFile = config.sops.secrets."wireguard/${hn}".path;
};
};
services = {
@ -53,8 +32,5 @@ let hn = config.networking.hostName; port = config.constants.port; wgi = "wgs";
resolved.enable = true;
};
sops.secrets = {
"cloudflare/${hn}" = { };
"wireguard/${hn}" = { };
};
sops.secrets."cloudflare/${hn}" = { };
}