summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/lanparty/lancache-dns.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2017-11-03 13:29:14 +0100
committermakefu <github@syntax-fehler.de>2017-11-03 13:29:14 +0100
commit8574f0f177c004031a4282d121931caab62158ad (patch)
treecd73f1561a17ee5c3bfbdc6a50b6d2ba496d7cd1 /makefu/2configs/lanparty/lancache-dns.nix
parent6cff70a8a56bba51d0c1ae718107e04c0df36fbc (diff)
ma lancache-dns: add storage server names
Diffstat (limited to 'makefu/2configs/lanparty/lancache-dns.nix')
-rw-r--r--makefu/2configs/lanparty/lancache-dns.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/makefu/2configs/lanparty/lancache-dns.nix b/makefu/2configs/lanparty/lancache-dns.nix
index 4b4ebf0a0..f03fe8773 100644
--- a/makefu/2configs/lanparty/lancache-dns.nix
+++ b/makefu/2configs/lanparty/lancache-dns.nix
@@ -21,6 +21,13 @@ let
stateDir = "/var/lib/unbound";
user = "unbound";
upstream-server = "8.8.8.8";
+ local_ip = "192.168.1.10";
+ extra-config = pkgs.writeText "local.conf" ''
+ server:
+ local-data: "piratebox. A ${local-ip}"
+ local-data: "store. A ${local-ip}"
+ local-data: "share. A ${local-ip}"
+ '';
in {
services.unbound = {
enable = true;
@@ -29,6 +36,7 @@ in {
forwardAddresses = [ upstream-server ];
extraConfig = ''
include: "${stateDir}/lancache/*.conf"
+ include: "${extra-config}"
'';
};
services.dnscrypt-proxy.enable = lib.mkForce false;
@@ -42,7 +50,8 @@ in {
path = [ pkgs.gawk pkgs.iproute pkgs.gnused ];
script = ''
set -xeu
- current_ip=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
+ # current_ip=$(ip route get 8.8.8.8 | awk '/8.8.8.8/ {print $NF}')
+ current_ip=${local_ip}
old_ip=10.1.1.250
mkdir -p ${stateDir}
rm -rvf ${stateDir}/lancache