Compare commits
No commits in common. "2c45da48447867728672d96febc2fae762d17c2c" and "0119c52db6bf709b30d7608b4c17245df6321bdc" have entirely different histories.
2c45da4844
...
0119c52db6
2 changed files with 3 additions and 18 deletions
|
|
@ -50,9 +50,9 @@ in {
|
||||||
"${downloadsHostname},everest"
|
"${downloadsHostname},everest"
|
||||||
];
|
];
|
||||||
systemd = {
|
systemd = {
|
||||||
services.caddy.after = ["tailscaled.service"];
|
units.tailscaled.requiredBy = ["caddy.service"];
|
||||||
# We have somewhat frequent power outages, and our ISP router takes
|
# We have somewhat frequent power outages, and our ISP router takes
|
||||||
# ages to boot up. If I don't add a delay, caddy tries to bind to
|
# ages to boot up. If I don't add a delay, traefik tries to bind to
|
||||||
# the tailscale interface before it's ready, making it crash too much
|
# the tailscale interface before it's ready, making it crash too much
|
||||||
# in too little time
|
# in too little time
|
||||||
services.caddy.serviceConfig.RestartSec = lib.mkForce "120s";
|
services.caddy.serviceConfig.RestartSec = lib.mkForce "120s";
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,6 @@
|
||||||
{pkgs, ...}: let
|
{...}: {
|
||||||
script = pkgs.writeShellApplication {
|
|
||||||
name = "tailscale-wait-for-ip";
|
|
||||||
runtimeInputs = [pkgs.iproute2];
|
|
||||||
text = ''
|
|
||||||
# Based on https://github.com/tailscale/tailscale/issues/11504#issuecomment-2113331262
|
|
||||||
echo Waiting for tailscale0 to get an IP adress..
|
|
||||||
for i in {1..15}; do
|
|
||||||
if ip addr show dev tailscale0 | grep -q 'inet '; then break; fi
|
|
||||||
echo "$i"
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
services.tailscale = {
|
services.tailscale = {
|
||||||
# This is needed for being an exit node
|
# This is needed for being an exit node
|
||||||
useRoutingFeatures = "server";
|
useRoutingFeatures = "server";
|
||||||
};
|
};
|
||||||
systemd.services.tailscaled.postStart = "${script}/bin/tailscale-wait-for-ip";
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue