diff --git a/morph/staging.nix b/morph/staging.nix new file mode 100644 index 0000000000000000000000000000000000000000..d9c5d9f12aab852a9610ab51712ca39dc74dd43d --- /dev/null +++ b/morph/staging.nix @@ -0,0 +1,21 @@ +let + # Pin the deployment package-set to a specific version of nixpkgs. This is + # NixOS 19.03 as of Aug 28 2019. There's nothing special about it. It's + # just recent at the time of development. It can be upgraded when there is + # value in doing so. + pkgs = import (builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/3c83ad6ac13b67101cc3e2e07781963a010c1624.tar.gz"; + sha256 = "0cdq342wrkvkyccygpp1gvwp7hhqg68hljjwld4vjixm901ayy14"; + }) {}; +in +{ + network = { + inherit pkgs; + description = "PrivateStorage.io Staging Grid"; + }; + + "staging000" = import ./staging000.nix { + publicIPv4 = "3.123.26.90"; + publicStoragePort = 8898; + }; +} diff --git a/morph/staging000-hardware.nix b/morph/staging000-hardware.nix new file mode 100644 index 0000000000000000000000000000000000000000..8eccc4b3e13d8f83838e1a07ab355956742e0e23 --- /dev/null +++ b/morph/staging000-hardware.nix @@ -0,0 +1,7 @@ +{ + imports = [ + <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> + ]; + + config.ec2.hvm = true; +} diff --git a/morph/staging000.nix b/morph/staging000.nix new file mode 100644 index 0000000000000000000000000000000000000000..cf726b457475c0f8d5a05f9f0a6a44ce711fe960 --- /dev/null +++ b/morph/staging000.nix @@ -0,0 +1,12 @@ +{ publicIPv4, publicStoragePort }: +{ imports = [ + ./staging000-hardware.nix + ../nixos/modules/private-storage.nix + ]; + + services.private-storage.enable = true; + services.private-storage.tahoe.node."tub.port" = "tcp:${toString publicStoragePort}"; + services.private-storage.tahoe.node."tub.location" = "tcp:${publicIPv4}:${toString publicStoragePort}"; + + networking.firewall.allowedTCPPorts = [ publicStoragePort ]; +}