summaryrefslogtreecommitdiff
path: root/custom
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-04-23 11:57:23 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-04-23 11:57:23 +0200
commit228b191389b989dcbec609e52371f0dda33ef51b (patch)
tree740b0bc67ccc573e12a6bc0ba5e17de3ab1ed09a /custom
parent6e61f94862f07b46c7454157c40fbef6cc27ef4c (diff)
downloadnixos-228b191389b989dcbec609e52371f0dda33ef51b.tar
nixos-228b191389b989dcbec609e52371f0dda33ef51b.tar.gz
nixos-228b191389b989dcbec609e52371f0dda33ef51b.tar.bz2
nixos-228b191389b989dcbec609e52371f0dda33ef51b.tar.xz
nixos-228b191389b989dcbec609e52371f0dda33ef51b.zip
dns via dhcp
Diffstat (limited to 'custom')
-rw-r--r--custom/tinc/yggdrasil.nix29
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
5let 5let
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 '';
26in { 7in {
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 };