From 32e2226434e854ade7b6b5ff94f1c0537f212147 Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@privatestorage.io>
Date: Tue, 1 Jun 2021 20:37:40 +0000
Subject: [PATCH] Re-use monitoringvpnKeyDir variable

---
 morph/grid/local/config.json |  2 +-
 morph/grid/local/grid.nix    | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/morph/grid/local/config.json b/morph/grid/local/config.json
index 457343ae..93779117 100644
--- a/morph/grid/local/config.json
+++ b/morph/grid/local/config.json
@@ -1,7 +1,7 @@
 { "publicStoragePort": 8898
 , "ristrettoSigningKeyPath": "./secrets/ristretto.signing-key"
 , "stripeSecretKeyPath": "./secrets/stripe.secret"
-, "monitoringvpnKeyFolder": "./secrets/monitoringvpn"
+, "monitoringvpnKeyDir": "./secrets/monitoringvpn"
 , "monitoringvpnEndpoint": "192.168.67.24:51820"
 , "passValue": 1000000
 , "issuerDomain": "payments.localdev"
diff --git a/morph/grid/local/grid.nix b/morph/grid/local/grid.nix
index da606417..4f9ec173 100644
--- a/morph/grid/local/grid.nix
+++ b/morph/grid/local/grid.nix
@@ -8,37 +8,37 @@ import ../../lib/make-grid.nix {
   let
     sshUsers = import ./users.nix;
     vpnClientIPs = [ "172.23.23.11" "172.23.23.12" "172.23.23.13" ]; # TBD: derive automatically
-    # Get vpn key folder relative to current dir, as a string:
-    monitoringvpnKeyDir = toString ./. + "/${cfg.monitoringvpnKeyFolder}";
+    # Get absolute vpn key directory path, as a string:
+    monitoringvpnKeyDir = toString ./. + "/${cfg.monitoringvpnKeyDir}";
   in {
-    "payments1" = import ../../lib/make-issuer.nix (rec {
+    "payments1" = import ../../lib/make-issuer.nix (cfg // rec {
       publicIPv4 = "192.168.67.21";
       monitoringvpnIPv4 = "172.23.23.11";
       inherit monitoringvpnKeyDir;
       inherit sshUsers;
       hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
       stateVersion = "19.03";
-    } // cfg);
+    });
 
-    "storage1" = import ../../lib/make-testing.nix (rec {
+    "storage1" = import ../../lib/make-testing.nix (cfg // rec {
       publicIPv4 = "192.168.67.22";
       monitoringvpnIPv4 = "172.23.23.12";
       inherit monitoringvpnKeyDir;
       inherit sshUsers;
       hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
       stateVersion = "19.09";
-    } // cfg);
+    });
 
-    "storage2" = import ../../lib/make-testing.nix (rec {
+    "storage2" = import ../../lib/make-testing.nix (cfg // rec {
       publicIPv4 = "192.168.67.23";
       monitoringvpnIPv4 = "172.23.23.13";
       inherit monitoringvpnKeyDir;
       inherit sshUsers;
       hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
       stateVersion = "19.09";
-    } // cfg);
+    });
 
-    "monitoring1" = import ../../lib/make-monitoring.nix (rec {
+    "monitoring1" = import ../../lib/make-monitoring.nix (cfg // rec {
       publicIPv4 = "192.168.67.24";
       monitoringvpnIPv4 = "172.23.23.1";
       inherit vpnClientIPs;
@@ -46,6 +46,6 @@ import ../../lib/make-grid.nix {
       inherit monitoringvpnKeyDir;
       hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
       stateVersion = "19.09";
-    } // cfg);
+    });
   };
 }
-- 
GitLab