Select Git revision
Forked from
PrivateStorage / PrivateStorageio
1264 commits behind the upstream repository.
-
Jean-Paul Calderone authored
Put its contents in it and then use them from there instead of importing them all over the rest of the code.
Jean-Paul Calderone authoredPut its contents in it and then use them from there instead of importing them all over the rest of the code.
grid.nix 2.15 KiB
let lib = import ../../lib;
in lib.make-grid {
# Make a morph configuration for this grid. We share this function
# with the other grids and have one fewer possible point of divergence.
name = "LocalDev";
config = ./config.json;
nodes = cfg:
let
sshUsers = import ./secrets/users.nix;
# Get absolute vpn key directory path, as a string:
monitoringvpnKeyDir = toString ./. + "/${cfg.monitoringvpnKeyDir}";
# TBD: derive these automatically:
hostsMap = {
"172.23.23.1" = [ "monitoring" "monitoring.monitoringvpn" ];
"172.23.23.11" = [ "payments" "payments.monitoringvpn" ];
"172.23.23.12" = [ "storage1" "storage1.monitoringvpn" ];
"172.23.23.13" = [ "storage2" "storage2.monitoringvpn" ];
};
vpnClientIPs = [ "172.23.23.11" "172.23.23.12" "172.23.23.13" ];
nodeExporterTargets = [ "monitoring" "payments" "storage1" "storage2" ];
in {
"payments" = lib.make-issuer (cfg // rec {
publicIPv4 = "192.168.67.21";
monitoringvpnIPv4 = "172.23.23.11";
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.03";
inherit monitoringvpnKeyDir;
inherit sshUsers;
});
"storage1" = lib.make-testing (cfg // rec {
publicIPv4 = "192.168.67.22";
monitoringvpnIPv4 = "172.23.23.12";
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
inherit monitoringvpnKeyDir;
inherit sshUsers;
});
"storage2" = lib.make-testing (cfg // rec {
publicIPv4 = "192.168.67.23";
monitoringvpnIPv4 = "172.23.23.13";
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
inherit monitoringvpnKeyDir;
inherit sshUsers;
});
"monitoring" = lib.make-monitoring (cfg // rec {
publicIPv4 = "192.168.67.24";
monitoringvpnIPv4 = "172.23.23.1";
inherit vpnClientIPs;
inherit hostsMap;
inherit nodeExporterTargets;
hardware = import ./virtual-hardware.nix ({ inherit publicIPv4; });
stateVersion = "19.09";
inherit monitoringvpnKeyDir;
inherit sshUsers;
});
};
}