summaryrefslogtreecommitdiff
path: root/custom/tinc
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2017-10-29 01:22:40 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2017-10-29 01:22:40 +0200
commit1796448fea9d67f6b8d8a5b669d7fadc9911e949 (patch)
tree4cdd27033d54d6f18f58518ad114b172ee75c2cb /custom/tinc
parent001e76a163568503be12117b3dd6ebfc20bac625 (diff)
downloadnixos-1796448fea9d67f6b8d8a5b669d7fadc9911e949.tar
nixos-1796448fea9d67f6b8d8a5b669d7fadc9911e949.tar.gz
nixos-1796448fea9d67f6b8d8a5b669d7fadc9911e949.tar.bz2
nixos-1796448fea9d67f6b8d8a5b669d7fadc9911e949.tar.xz
nixos-1796448fea9d67f6b8d8a5b669d7fadc9911e949.zip
Better tinc scripts
Diffstat (limited to 'custom/tinc')
-rw-r--r--custom/tinc/yggdrasil.nix16
1 files changed, 9 insertions, 7 deletions
diff --git a/custom/tinc/yggdrasil.nix b/custom/tinc/yggdrasil.nix
index 2e5a2442..46d815a3 100644
--- a/custom/tinc/yggdrasil.nix
+++ b/custom/tinc/yggdrasil.nix
@@ -19,19 +19,21 @@ with stdenv.lib;
19 ${optionalString connect "ConnectTo = ymir"} 19 ${optionalString connect "ConnectTo = ymir"}
20 ''; 20 '';
21 scripts = { 21 scripts = {
22 tinc-up = '' 22 "hosts/borealis-up" = ''
23 #!${stdenv.shell} 23 #!${stdenv.shell}
24 ${nettools}/bin/route add -net 10.141.1.0 netmask 255.255.255.0 gw 10.141.1.1 dev $INTERFACE metric 9999 24 ${nettools}/bin/route add -net 10.141.1.0 netmask 255.255.255.0 gw 10.141.1.1 dev $INTERFACE metric 9999
25 ${optionalString useDNS '' 25 ${optionalString useDNS ''
26 ${openresolv}/bin/resolvconf -m 0 -a tinc.yggdrasil <<EOF 26 ${openresolv}/bin/resolvconf -m 0 -a tinc.yggdrasil <<EOF
27 domain yggdrasil 27 domain yggdrasil
28 nameserver 10.141.1.1 28 nameserver 10.141.1.1
29 EOF''} 29 EOF
30 ''}
30 ''; 31 '';
31 tinc-down = '' 32 "hosts/borealis-down" = ''
32 #!${stdenv.shell} 33 #!${stdenv.shell}
34 ${nettools}/bin/route del -net 10.141.1.0 netmask 255.255.255.0 gw 10.141.1.1 dev $INTERFACE
33 ${optionalString useDNS '' 35 ${optionalString useDNS ''
34 ${openresolv}/bin/resolvconf -d tinc.yggdrasil 36 ${openresolv}/bin/resolvconf -d tinc.yggdrasil
35 ''} 37 ''}
36 ''; 38 '';
37 }; 39 };