{ config, pkgs, ... }: let name = "unknown"; ip = "xxx.xxx.xxx.xxx"; in { config.services.tinc = { networks = { "laeradhr" = { name = name; debugLevel = 2; hosts = ( import ./laeradhr-hosts.nix ); extraConfig = "ConnectTo = surtr"; scripts = { tinc-up = '' #!${pkgs.stdenv.shell} ${pkgs.nettools}/bin/route add -net 10.141.1.0 netmask 255.255.255.0 gw 10.142.0.2 dev $INTERFACE metric 9999 ${pkgs.openresolv}/bin/resolvconf -m 0 -a tinc.laeradhr <<EOF domain yggdrasil nameserver 10.141.1.1 EOF''; tinc-down = '' #!${pkgs.stdenv.shell} ${pkgs.openresolv}/bin/resolvconf -d tinc.laeradhr''; }; }; }; }; config.networking.interfaces."tinc.laeradhr" = { useDHCP = false; ip4 = [ { address = ip; prefixLength = 16; } ]; }; }