rpi4: wait for dns before starting wireguard

This commit is contained in:
NullBite 2024-07-02 21:37:21 -04:00
parent b768644314
commit 8f7e6a72c1
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -37,6 +37,10 @@
file = ../../secrets/wireguard-rpi4.age;
};
services.tailscale.enable = true;
systemd.services.wg-quick-wg0.serviceConfig.execStartPre = pkgs.writeShellScript "wait-dns" ''
until ${lib.getExe pkgs.getent} ahostsv4 example.com ; do echo sleep 1 ; done
'';
networking.wg-quick.interfaces.wg0 = {
configFile = config.age.secrets.wg0.path;
autostart = true;