From cb796ce05b00bbdc3fc6d4109483f1bd257cc147 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Jan 2023 15:38:56 +0100 Subject: tinc: remove parentheses of fear --- krebs/3modules/tinc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'krebs/3modules/tinc.nix') diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index f6727e4d4..7154ecdc3 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -128,9 +128,9 @@ with import ; default = pkgs.write "${tinc.config.netname}-tinc-hosts" (mapAttrs' - (_: host: (nameValuePair "/${host.name}" { + (_: host: nameValuePair "/${host.name}" { text = host.nets.${tinc.config.netname}.tinc.config; - })) + }) tinc.config.hosts); defaultText = "‹netname›-tinc-hosts"; description = '' -- cgit v1.2.3 From c8c916ccf1a95f0e755094fd3d24403af91a0b67 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Jan 2023 18:24:47 +0100 Subject: tinc: untangle tincUp and tincUpExtra --- krebs/3modules/tinc.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'krebs/3modules/tinc.nix') diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index 7154ecdc3..4afd0a3a6 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -26,9 +26,9 @@ with import ; Port = ${toString tinc.config.host.nets.${netname}.tinc.port} ${tinc.config.extraConfig} ''; - "tinc-up" = pkgs.writeDash "${netname}-tinc-up" '' - ${tinc.config.iproutePackage}/sbin/ip link set ${netname} up + "tinc-up" = pkgs.writeDash "${netname}-tinc-up" /* sh */ '' ${tinc.config.tincUp} + ${tinc.config.tincUpExtra} ''; }); }; @@ -60,7 +60,8 @@ with import ; default = let net = tinc.config.host.nets.${netname}; iproute = tinc.config.iproutePackage; - in '' + in /* sh */ '' + ${tinc.config.iproutePackage}/sbin/ip link set ${netname} up ${optionalString (net.ip4 != null) /* sh */ '' ${iproute}/sbin/ip -4 addr add ${net.ip4.addr} dev ${netname} ${iproute}/sbin/ip -4 route add ${net.ip4.prefix} dev ${netname} @@ -69,14 +70,13 @@ with import ; ${iproute}/sbin/ip -6 addr add ${net.ip6.addr} dev ${netname} ${iproute}/sbin/ip -6 route add ${net.ip6.prefix} dev ${netname} ''} - ${tinc.config.tincUpExtra} ''; - defaultText = '' - ip -4 addr add ‹net.ip4.addr› dev ${netname} - ip -4 route add ‹net.ip4.prefix› dev ${netname} - ip -6 addr add ‹net.ip6.addr› dev ${netname} - ip -6 route add ‹net.ip6.prefix› dev ${netname} - ${tinc.config.tincUpExtra} + defaultText = /* sh */ '' + ip link set ‹netname› up + ip -4 addr add ‹net.ip4.addr› dev ‹netname› + ip -4 route add ‹net.ip4.prefix› dev ‹netname› + ip -6 addr add ‹net.ip6.addr› dev ‹netname› + ip -6 route add ‹net.ip6.prefix› dev ‹netname› ''; description = '' tinc-up script to be used. Defaults to setting the -- cgit v1.2.3 From ebd22b2d282d3b718f173a243615d954e00254e9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Jan 2023 18:44:56 +0100 Subject: tinc: drop tincUpExtra --- krebs/3modules/tinc.nix | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'krebs/3modules/tinc.nix') diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index 4afd0a3a6..52cdafe67 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -26,10 +26,7 @@ with import ; Port = ${toString tinc.config.host.nets.${netname}.tinc.port} ${tinc.config.extraConfig} ''; - "tinc-up" = pkgs.writeDash "${netname}-tinc-up" /* sh */ '' - ${tinc.config.tincUp} - ${tinc.config.tincUpExtra} - ''; + "tinc-up" = pkgs.writeDash "${netname}-tinc-up" tinc.config.tincUp; }); }; @@ -85,11 +82,6 @@ with import ; ''; }; - tincUpExtra = mkOption { - type = types.str; - default = ""; - }; - tincPackage = mkOption { type = types.package; default = pkgs.tinc_pre; -- cgit v1.2.3