Commit 59a029d
Changed files (1)
modules
core
modules/core/tailscale.nix
@@ -1,4 +1,8 @@
{
+ den,
+ lib,
+ ...
+}: {
den.aspects.core.tailscale = {
persist = {
directories = [
@@ -10,6 +14,7 @@
};
nixos = {
+ host,
config,
pkgs,
...
@@ -20,10 +25,16 @@
enable = true;
extraUpFlags = [
"--login-server=https://gate.trin.one"
- "--accept-dns=true"
];
};
+ networking.hosts = lib.concatMapAttrs (hostname: {address, ...}:
+ lib.optionalAttrs (hostname != host.name) {
+ ${address.ipv4.tailscale} = [hostname];
+ ${address.ipv6.tailscale} = [hostname];
+ })
+ (lib.mergeAttrsList (lib.attrValues den.hosts));
+
networking.firewall = {
trustedInterfaces = [config.services.tailscale.interfaceName];
allowedUDPPorts = [config.services.tailscale.port];