From e6e9fcc16a86d2b6f93bca0672e4ba746c02ee1c Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Wed, 23 Jun 2021 12:44:43 -0400
Subject: [PATCH] Stop using make-grid for testing deployment

---
 morph/grid/testing/grid.nix | 81 +++++++++++++++++++------------------
 1 file changed, 42 insertions(+), 39 deletions(-)

diff --git a/morph/grid/testing/grid.nix b/morph/grid/testing/grid.nix
index cfc87a80..78c3df86 100644
--- a/morph/grid/testing/grid.nix
+++ b/morph/grid/testing/grid.nix
@@ -1,47 +1,50 @@
 # See morph/grid/local/grid.nix for additional commentary.
-let lib = import ../../lib;
-in lib.make-grid {
-  name = "Testing";
-  config = ./config.json;
-  nodes = cfg:
-  let
-    sshUsers = import ./secrets/users.nix;
+let
+  pkgs = import <nixpkgs> { };
 
-    # Get absolute vpn key directory path, as a string:
-    monitoringvpnKeyDir = toString ./. + "/${cfg.monitoringvpnKeyDir}";
+  lib = import ../../lib;
+  config = pkgs.lib.trivial.importJSON ./config.json;
+  sshUsers = import ./secrets/users.nix;
 
-    # TBD: derive these automatically:
-    hostsMap = {
-      "172.23.23.1"  = [ "monitoring" "monitoring.monitoringvpn" ];
-      "172.23.23.11" = [ "payments"   "payments.monitoringvpn"   ];
-      "172.23.23.12" = [ "storage001" "storage001.monitoringvpn" ];
-    };
-    vpnClientIPs = [ "172.23.23.11" "172.23.23.12" ];
-    nodeExporterTargets = [ "monitoring" "payments" "storage001" ];
+  # Get absolute vpn key directory path, as a string:
+  monitoringvpnKeyDir = toString ./. + "/${config.monitoringvpnKeyDir}";
 
-  in {
-    payments = {
-      imports = [
-        lib.issuer
-        lib.hardware-aws
-        (lib.customize-issuer cfg sshUsers monitoringvpnKeyDir "172.23.23.11" "19.03")
-      ];
-    };
+  payments = {
+    imports = [
+      lib.issuer
+      lib.hardware-aws
+      (lib.customize-issuer config sshUsers monitoringvpnKeyDir "172.23.23.11" "19.03")
+    ];
+  };
+
+  storage001 = let publicIPv4 = "3.120.26.190"; in {
+    imports = [
+      lib.storage
+      ./testing001-hardware.nix
+      (lib.customize-storage config sshUsers publicIPv4 monitoringvpnKeyDir "172.23.23.12" "19.03")
+    ];
+  };
 
-    storage001 = let publicIPv4 = "3.120.26.190"; in {
-      imports = [
-        lib.storage
-        ./testing001-hardware.nix
-        (lib.customize-storage cfg sshUsers publicIPv4 monitoringvpnKeyDir "172.23.23.12" "19.03")
-      ];
-    };
+  monitoring = let publicIPv4 = "18.156.171.217"; in {
+    imports = [
+      lib.monitoring
+      lib.hardware-aws
+      (lib.customize-monitoring hostsMap monitoringvpnKeyDir publicIPv4 "172.23.23.1" vpnClientIPs nodeExporterTargets [] "19.09")
+    ];
+  };
+
+  # TBD: derive these automatically:
+  hostsMap = {
+    "172.23.23.1"  = [ "monitoring" "monitoring.monitoringvpn" ];
+    "172.23.23.11" = [ "payments"   "payments.monitoringvpn"   ];
+    "172.23.23.12" = [ "storage001" "storage001.monitoringvpn" ];
+  };
+  vpnClientIPs = [ "172.23.23.11" "172.23.23.12" ];
+  nodeExporterTargets = [ "monitoring" "payments" "storage001" ];
 
-    monitoring = let publicIPv4 = "18.156.171.217"; in {
-      imports = [
-        lib.monitoring
-        lib.hardware-aws
-        (lib.customize-monitoring hostsMap monitoringvpnKeyDir publicIPv4 "172.23.23.1" vpnClientIPs nodeExporterTargets [] "19.09")
-      ];
-    };
+in {
+  network = {
+    description = "PrivateStorage.io Testing Grid";
   };
+  inherit payments monitoring storage001;
 }
-- 
GitLab