From c19d6b3152aa4d94b8addb283378617db0b9bad7 Mon Sep 17 00:00:00 2001 From: hektor Date: Mon, 15 Jun 2026 08:35:49 +0200 Subject: [PATCH] refactor(deploy): set up tailnet 'colmena' deploy --- deploy/colmena.nix | 7 ++++--- home/modules/deploy/default.nix | 8 +------- hosts/andromache/meta.nix | 2 +- hosts/astyanax/meta.nix | 2 +- hosts/eetion-02/meta.nix | 2 +- hosts/eetion/meta.nix | 2 +- hosts/hecuba/meta.nix | 2 +- hosts/vm/meta.nix | 2 +- 8 files changed, 11 insertions(+), 16 deletions(-) diff --git a/deploy/colmena.nix b/deploy/colmena.nix index ade76e4d..42cc0e30 100644 --- a/deploy/colmena.nix +++ b/deploy/colmena.nix @@ -12,7 +12,7 @@ let hostname: let meta = utils.hostMeta ../hosts/${hostname}; - isLocal = builtins.elem "local" meta.tags; + isArm = meta.system == "aarch64-linux"; in { imports = [ ../hosts/${hostname} ]; @@ -20,8 +20,9 @@ let deployment = { inherit (meta) tags; targetUser = meta.host.username; - targetHost = if isLocal then "" else hostname; - buildOnTarget = builtins.any (t: t != "local" && t != "arm") meta.tags; + targetHost = hostname; + allowLocalDeployment = meta.host.admin or false; + buildOnTarget = !isArm; }; }; diff --git a/home/modules/deploy/default.nix b/home/modules/deploy/default.nix index 1bf98309..47b3954d 100644 --- a/home/modules/deploy/default.nix +++ b/home/modules/deploy/default.nix @@ -19,14 +19,11 @@ let colmena = inputs.colmena.packages.${pkgs.stdenv.hostPlatform.system}.colmena; hostTags = hostname: (myUtils.hostMeta (hostDir + "/${hostname}")).tags; - remoteHostsWithKeys = lib.filter ( - hostname: !(builtins.elem "local" (hostTags hostname)) - ) hostsWithKeys; nodeTagsDecl = '' declare -A _colmena_node_tags=( ${lib.concatMapStringsSep "\n" ( hostname: " [${hostname}]=${lib.escapeShellArg (lib.concatStringsSep " " (hostTags hostname))}" - ) remoteHostsWithKeys} + ) hostsWithKeys} ) ''; @@ -56,12 +53,9 @@ in hostname: let meta = myUtils.hostMeta (hostDir + "/${hostname}"); - isLocal = builtins.elem "local" meta.tags; in { User = meta.host.username; - } - // lib.optionalAttrs (!isLocal) { HostName = hostname; ControlPath = "~/.ssh/socket-%r@%h:%p"; } diff --git a/hosts/andromache/meta.nix b/hosts/andromache/meta.nix index c286ffe8..171cb53a 100644 --- a/hosts/andromache/meta.nix +++ b/hosts/andromache/meta.nix @@ -1,7 +1,7 @@ { system = "x86_64-linux"; role = "desktop"; - tags = [ "local" ]; + tags = [ "personal" ]; host = { username = "h"; highRam = true; diff --git a/hosts/astyanax/meta.nix b/hosts/astyanax/meta.nix index eb93152d..3b7f792e 100644 --- a/hosts/astyanax/meta.nix +++ b/hosts/astyanax/meta.nix @@ -1,7 +1,7 @@ { system = "x86_64-linux"; role = "laptop"; - tags = [ "local" ]; + tags = [ "personal" ]; host = { username = "h"; highRam = true; diff --git a/hosts/eetion-02/meta.nix b/hosts/eetion-02/meta.nix index a9a0031c..6b1e816f 100644 --- a/hosts/eetion-02/meta.nix +++ b/hosts/eetion-02/meta.nix @@ -1,7 +1,7 @@ { system = "aarch64-linux"; role = "embedded"; - tags = [ "arm" ]; + tags = [ "lab" ]; host = { username = "h"; }; diff --git a/hosts/eetion/meta.nix b/hosts/eetion/meta.nix index a9a0031c..6b1e816f 100644 --- a/hosts/eetion/meta.nix +++ b/hosts/eetion/meta.nix @@ -1,7 +1,7 @@ { system = "aarch64-linux"; role = "embedded"; - tags = [ "arm" ]; + tags = [ "lab" ]; host = { username = "h"; }; diff --git a/hosts/hecuba/meta.nix b/hosts/hecuba/meta.nix index 2fa15241..21735c53 100644 --- a/hosts/hecuba/meta.nix +++ b/hosts/hecuba/meta.nix @@ -1,7 +1,7 @@ { system = "x86_64-linux"; role = "server"; - tags = [ "cloud" ]; + tags = [ "lab" ]; host = { username = "username"; }; diff --git a/hosts/vm/meta.nix b/hosts/vm/meta.nix index f46dfe50..61e7dd2a 100644 --- a/hosts/vm/meta.nix +++ b/hosts/vm/meta.nix @@ -1,7 +1,7 @@ { system = "x86_64-linux"; role = "vm"; - tags = [ "local" ]; + tags = [ "lab" ]; host = { username = "h"; };