diff --git a/components/hm/ssh.nix b/components/hm/ssh.nix index 8fb7ade..7d9bb05 100644 --- a/components/hm/ssh.nix +++ b/components/hm/ssh.nix @@ -117,23 +117,13 @@ in user = "luser"; }; # LINODE SERVERS - # "l001" = { - # identityFile = age.secrets.nix2linode.path; - # hostname = "10.20.40.##"; TODO - # user = "root"; - # }; - "l001_" = { + "l002_" = { identityFile = age.secrets.nix2linode.path; hostname = "172.234.26.141"; user = "root"; }; - "l002_" = { - identityFile = age.secrets.nix2l002.path; - hostname = "172.232.4.54"; - user = "luser"; - }; "l002" = { - identityFile = age.secrets.nix2l002.path; + identityFile = age.secrets.nix2linode.path; hostname = "10.20.40.1"; user = "luser"; }; diff --git a/flake.nix b/flake.nix index 914abc2..43e5a7e 100644 --- a/flake.nix +++ b/flake.nix @@ -50,11 +50,36 @@ fi done ''; + mod_status = pkgs.writeShellScriptBin "mod_status" '' + cwd=$(pwd) + root=$(git rev-parse --show-toplevel) + for dir in "$root"/modules/*/; do + cd "$dir" + echo + echo " >> $(basename "$dir"):" + git status + done + cd "$cwd" + ''; + linode_deploy = pkgs.writeShellScriptBin "linode_deploy" '' + cwd=$(pwd) + root=$(git rev-parse --show-toplevel) + if [ ! -d "$root/hosts/linode/$1" ]; then + echo "Host $1 does not exist" + exit 1 + fi + cd "$root/hosts/linode/$1" + echo "Deploying $(basename "$(pwd)")..." + deploy + cd "$cwd" + ''; in { default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ mod_worktrees + mod_status + linode_deploy deploy-rs ]; diff --git a/hosts/linode/l001/configuration.nix b/hosts/linode/l002/configuration.nix similarity index 100% rename from hosts/linode/l001/configuration.nix rename to hosts/linode/l002/configuration.nix diff --git a/hosts/linode/l001/flake.lock b/hosts/linode/l002/flake.lock similarity index 100% rename from hosts/linode/l001/flake.lock rename to hosts/linode/l002/flake.lock diff --git a/hosts/linode/l001/flake.nix b/hosts/linode/l002/flake.nix similarity index 100% rename from hosts/linode/l001/flake.nix rename to hosts/linode/l002/flake.nix diff --git a/hosts/linode/l001/hardware-configuration.nix b/hosts/linode/l002/hardware-configuration.nix similarity index 100% rename from hosts/linode/l001/hardware-configuration.nix rename to hosts/linode/l002/hardware-configuration.nix diff --git a/hosts/linode/l001/linode.nix b/hosts/linode/l002/linode.nix similarity index 100% rename from hosts/linode/l001/linode.nix rename to hosts/linode/l002/linode.nix diff --git a/hosts/linode/l001/nginx.nix b/hosts/linode/l002/nginx.nix similarity index 96% rename from hosts/linode/l001/nginx.nix rename to hosts/linode/l002/nginx.nix index f9efd25..21d9483 100644 --- a/hosts/linode/l001/nginx.nix +++ b/hosts/linode/l002/nginx.nix @@ -76,6 +76,11 @@ proxyPass = "http://localhost:42291"; }; }; + "nexus.joshuabell.xyz" = { + locations."/" = { + proxyPass = "http://localhost:42291"; + }; + }; # Redirect self IP to domain "172.234.26.141" = { @@ -127,7 +132,7 @@ enableACME = true; forceSSL = true; locations."/" = { - return = "404"; + return = "444"; }; }; diff --git a/hosts/linode/l004/flake.nix b/hosts/linode/l004/flake.nix index 614eefe..8f80c2f 100644 --- a/hosts/linode/l004/flake.nix +++ b/hosts/linode/l004/flake.nix @@ -23,7 +23,7 @@ sshUser = "root"; sshOpts = [ "-i" - "/run/agenix/nix2l002" + "/run/agenix/nix2linode" ]; nodes.${configuration_name} = { hostname = "172.232.11.143"; @@ -56,7 +56,6 @@ { pkgs, ... }: { users.users.root.openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLBVLiPbhVG+riNNpkvXnNtOioByV3CQwtY9gu8pstp nix2l002" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuo6L6V52AzdQIK6fWW9s0aX1yKUUTXbPd8v8IU9p2o nix2linode" ]; mods = { @@ -74,7 +73,6 @@ ]; isNormalUser = true; openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFLBVLiPbhVG+riNNpkvXnNtOioByV3CQwtY9gu8pstp nix2l002" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJuo6L6V52AzdQIK6fWW9s0aX1yKUUTXbPd8v8IU9p2o nix2linode" ]; };