diff --git a/flake.nix b/flake.nix index 65e624a..70c73cc 100644 --- a/flake.nix +++ b/flake.nix @@ -99,10 +99,50 @@ devShell = forAllSystems (system: let pkgs = import nixpkgs { system = "x86_64-linux"; }; + copy-containers = pkgs.writeShellScriptBin "copy-containers" + '' + _profile="$1" + _address="$2" + _selector="$3" + + function profile_blowhole() + { + _images=("camptules" "gitea" "home-assistant" "hydra" \ + "minecraft" "mosquitto" "website" "zigbee2mqtt") + + for _image in ''${_images[@]} + do + deploy $_address $_image + done + } + + function profile_toothpick() + { + images=("ingress") + + for _image in ''${_images[@]} + do + deploy $_address $_image + done + } + + function deploy() + { + _address="$1" + _image="$2" + + nix build ".#ociImages.$_image.stream" -o result-script && \ + ./result-script | ssh "$_address" docker load && \ + ssh "$_address" docker tag "nixng-$_image:latest" "nixng-$_image:local" + } + + "profile_$_profile" + ''; in pkgs.mkShell { nativeBuildInputs = with pkgs; [ nomad_1_1 consul vault jq + copy-containers ]; } ); diff --git a/infrastructure/mesh/nomad.hcl b/infrastructure/mesh/nomad.hcl index 3313634..c12d595 100644 --- a/infrastructure/mesh/nomad.hcl +++ b/infrastructure/mesh/nomad.hcl @@ -8,7 +8,6 @@ job "gateway-mesh" { mode = "bridge" port "mesh_wan" { - host_network = "vpn" } } diff --git a/infrastructure/website/nomad.hcl b/infrastructure/website/nomad.hcl index 76f4d55..607ad8e 100644 --- a/infrastructure/website/nomad.hcl +++ b/infrastructure/website/nomad.hcl @@ -50,16 +50,8 @@ job "website" { task "apache" { driver = "docker" - artifact { - source = "http://hydra.redalder.org/build/101/download/1/image.tar.gz" - options { - archive = false - } - } - config { - load = "image.tar.gz" - image = "nixng-website" + image = "nixng-website:local" memory_hard_limit = 64 }