From 06f9bbbc78e0c9320037c5fb9d6bf740e3b81ee3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 13 Aug 2018 09:37:58 +0200 Subject: ... --- custom/tinc/def.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'custom/tinc') diff --git a/custom/tinc/def.nix b/custom/tinc/def.nix index 3a6dcfa8..7e7e83b2 100644 --- a/custom/tinc/def.nix +++ b/custom/tinc/def.nix @@ -124,11 +124,9 @@ in )) // { "tinc/${network}/tinc.conf" = { text = '' - Name = ${if data.name == null then "$HOST" else data.name} + Name = ${if data.name == null then config.networking.hostName else data.name} DeviceType = ${data.interfaceType} - Device = /dev/net/tun Interface = ${network} - ExperimentalProtocol = no ${data.extraConfig} ''; }; @@ -137,12 +135,11 @@ in environment.systemPackages = mapAttrsToList (_: data: data.package) cfg.networks; - networking.interfaces = flip mapAttrs' cfg.networks (network: data: nameValuePair - (network) - ({ + networking.interfaces = flip mapAttrs cfg.networks (network: data: + { virtual = true; virtualType = "${data.interfaceType}"; - } // data.interfaceConfig) + } // data.interfaceConfig ); networking.networkmanager.dispatcherScripts = concatLists (flip mapAttrsToList cfg.networks (network: data: optional data.nmDispatch { @@ -154,7 +151,7 @@ in case "''${2}" in (?(vpn-)up) - ${pkgs.systemd}/bin/systemctl --signal=ALRM --kill-who=main kill "tinc.${network}.service" + ${data.package}/bin/tinc -n ${network} --pidfile /run/tinc.${network}.pid retry ;; esac ''; @@ -176,8 +173,6 @@ in ''; }; preStart = '' - ${pkgs.openresolv}/bin/resolvconf -d tinc.${network} || true - mkdir -p /etc/tinc/${network}/hosts # Determine how we should generate our keys -- cgit v1.2.3