diff options
Diffstat (limited to 'custom/tinc/yggdrasil.nix')
-rw-r--r-- | custom/tinc/yggdrasil.nix | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/custom/tinc/yggdrasil.nix b/custom/tinc/yggdrasil.nix index 34933a19..2caa74a0 100644 --- a/custom/tinc/yggdrasil.nix +++ b/custom/tinc/yggdrasil.nix | |||
@@ -4,25 +4,6 @@ with lib; | |||
4 | 4 | ||
5 | let | 5 | let |
6 | cfg = config.services.yggdrasilTinc; | 6 | cfg = config.services.yggdrasilTinc; |
7 | |||
8 | heimdallr-up = pkgs.writeScript "heimdallr-up.sh" '' | ||
9 | #!${pkgs.stdenv.shell} | ||
10 | ${pkgs.nettools}/bin/route add -net 10.141.1.0 netmask 255.255.255.0 gw 10.141.1.1 dev $INTERFACE metric 9999 | ||
11 | ${optionalString cfg.useDNS '' | ||
12 | ${pkgs.openresolv}/bin/resolvconf -m 0 -a yggdrasil <<EOF | ||
13 | domain yggdrasil | ||
14 | nameserver 10.141.1.1 | ||
15 | EOF | ||
16 | ''} | ||
17 | ''; | ||
18 | |||
19 | heimdallr-down = pkgs.writeScript "heimdallr-down.sh" '' | ||
20 | #!${pkgs.stdenv.shell} | ||
21 | ${pkgs.nettools}/bin/route del -net 10.141.1.0 netmask 255.255.255.0 gw 10.141.1.1 dev $INTERFACE | ||
22 | ${optionalString cfg.useDNS '' | ||
23 | ${pkgs.openresolv}/bin/resolvconf -d yggdrasil | ||
24 | ''} | ||
25 | ''; | ||
26 | in { | 7 | in { |
27 | options = { | 8 | options = { |
28 | services.yggdrasilTinc = { | 9 | services.yggdrasilTinc = { |
@@ -87,16 +68,6 @@ in { | |||
87 | MACFILE="/var/db/$NETNAME.mac" | 68 | MACFILE="/var/db/$NETNAME.mac" |
88 | [ -e $MACFILE ] && ${pkgs.iproute}/bin/ip link set dev $INTERFACE address `cat $MACFILE` || cat /sys/class/net/$INTERFACE/address >$MACFILE | 69 | [ -e $MACFILE ] && ${pkgs.iproute}/bin/ip link set dev $INTERFACE address `cat $MACFILE` || cat /sys/class/net/$INTERFACE/address >$MACFILE |
89 | ''; | 70 | ''; |
90 | "hosts/heimdallr-up" = '' | ||
91 | #!${pkgs.stdenv.shell} | ||
92 | |||
93 | exec ${config.security.wrapperDir}/sudo -En ${heimdallr-up} | ||
94 | ''; | ||
95 | "hosts/heimdallr-down" = '' | ||
96 | #!${pkgs.stdenv.shell} | ||
97 | |||
98 | exec ${config.security.wrapperDir}/sudo -En ${heimdallr-down} | ||
99 | ''; | ||
100 | }; | 71 | }; |
101 | }; | 72 | }; |
102 | }; | 73 | }; |