From 394408c9b715a2dfb6aba560c4db71b78cf46f8d Mon Sep 17 00:00:00 2001
From: makefu <github@syntax-fehler.de>
Date: Sun, 27 Sep 2015 15:23:54 +0200
Subject: [PATCH] 3modules: add wry

---
 krebs/3modules/default.nix | 43 +++++++++++++++++++++++++++++++++++++-
 makefu/1systems/wry.nix    | 34 ++++++++++++++++++++++++++++++
 2 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 makefu/1systems/wry.nix

diff --git a/krebs/3modules/default.nix b/krebs/3modules/default.nix
index 0ffdec5f8..f88ef2194 100644
--- a/krebs/3modules/default.nix
+++ b/krebs/3modules/default.nix
@@ -575,7 +575,6 @@ let
                               IN MX 10  mx42
             euer              IN MX 1   aspmx.l.google.com.
             io                IN NS     pigstarter.krebsco.de.
-            euer              IN A      ${elemAt nets.internet.addrs4 0}
             pigstarter        IN A      ${elemAt nets.internet.addrs4 0}
             conf              IN A      ${elemAt nets.internet.addrs4 0}
             gold              IN A      ${elemAt nets.internet.addrs4 0}
@@ -611,6 +610,47 @@ let
           };
         };
       };
+      wry = rec {
+        cores = 1;
+        dc = "makefu"; #dc = "cac";
+        extraZones = {
+          "krebsco.de" = ''
+            wry            IN A ${elemAt nets.internet.addrs4 0}
+            '';
+        };
+        nets = rec {
+          internet = {
+            addrs4 = ["162.219.7.216"];
+            aliases = [
+              "wry.internet"
+            ];
+          };
+          retiolum = {
+            via = internet;
+            addrs4 = [""];
+            addrs6 = [""];
+            aliases = [
+              "wry.retiolum"
+              "cgit.cd.retiolum"
+            ];
+            tinc.pubkey = ''
+              -----BEGIN RSA PUBLIC KEY-----
+              MIICCgKCAgEAvmCBVNKT/Su4v9nl/Nm3STPo5QxWPg7xEkzIs3Oh39BS8+r6/7UQ
+              rebib7mczb+ebZd+Rg2yFoGrWO8cmM0VcLy5bYRMK7in8XroLEjWecNNM4TRfNR4
+              e53+LhcPdkxo0A3/D+yiut+A2Mkqe+4VXDm/JhAiAYkZTn7jUtj00Atrc7CWW1gN
+              sP3jIgv4+CGftdSYOB4dm699B7OD9XDLci2kOaFqFl4cjDYUok03G0AduUlRx10v
+              CKbKOTIdm8C36A902/3ms+Hyzkruu+VagGIZuPSwqXHJPCu7Ju+jarKQstMmpQi0
+              PubweWDL0o/Dfz2qT3DuL4xDecIvGE6kv3m41hHJYiK+2/azTSehyPFbsVbL7w0V
+              LgKN3usnZNcpTsBWxRGT7nMFSnX2FLDu7d9OfCuaXYxHVFLZaNrpccOq8NF/7Hbk
+              DDW81W7CvLyJDlp0WLnAawSOGTUTPoYv/2wAapJ89i8QGCueGvEc6o2EcnBVMFEW
+              ejWTQzyD816f4RsplnrRqLVlIMbr9Q/n5TvlgjjhX7IMEfMy4+7qLGRQkNbFzgwK
+              jxNG2fFSCjOEQitm0gAtx7QRIyvYr6c7/xiHz4AwxYzBmvQsL/OK57NO4+Krwgj5
+              Vk8TQ2jGO7J4bB38zaxK+Lrtfl8i1AK1171JqFMhOc34JSJ7T4LWDMECAwEAAQ==
+              -----END RSA PUBLIC KEY-----
+            '';
+          };
+        };
+      };
       gum = rec {
         cores = 1;
         dc = "online.net"; #root-server
@@ -618,6 +658,7 @@ let
         extraZones = {
           "krebsco.de" = ''
             omo               IN A      ${elemAt nets.internet.addrs4 0}
+            euer              IN A      ${elemAt nets.internet.addrs4 0}
             gum               IN A      ${elemAt nets.internet.addrs4 0}
             paste             IN A      ${elemAt nets.internet.addrs4 0}'';
         };
diff --git a/makefu/1systems/wry.nix b/makefu/1systems/wry.nix
new file mode 100644
index 000000000..29ad82d4c
--- /dev/null
+++ b/makefu/1systems/wry.nix
@@ -0,0 +1,34 @@
+{ config, lib, pkgs, ... }:
+
+let
+
+  ip = (lib.elemAt config.krebs.build.host.nets.internet.addrs4 0);
+in {
+  imports = [
+    ../../tv/2configs/CAC-CentOS-7-64bit.nix
+    ../2configs/base.nix
+    ../2configs/tinc-basic-retiolum.nix
+    {
+    }
+  ];
+  networking.firewall.allowPing = true;
+  networking.interfaces.enp2s1.ip4 = [
+      {
+        address = ip;
+        prefixLength = 24;
+      }
+    ];
+    networking.defaultGateway = "104.233.80.1";
+    networking.nameservers = [
+      "8.8.8.8"
+    ];
+
+  # based on ../../tv/2configs/CAC-Developer-2.nix
+  sound.enable = false;
+  krebs.build = {
+    user = config.krebs.users.makefu;
+    target = "root@${ip}";
+    host = config.krebs.hosts.wry;
+  };
+
+}