refactor(deploy): set up tailnet 'colmena' deploy

This commit is contained in:
2026-06-15 08:35:49 +02:00
parent e845834833
commit c19d6b3152
8 changed files with 11 additions and 16 deletions
+4 -3
View File
@@ -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;
};
};
+1 -7
View File
@@ -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";
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
system = "x86_64-linux";
role = "desktop";
tags = [ "local" ];
tags = [ "personal" ];
host = {
username = "h";
highRam = true;
+1 -1
View File
@@ -1,7 +1,7 @@
{
system = "x86_64-linux";
role = "laptop";
tags = [ "local" ];
tags = [ "personal" ];
host = {
username = "h";
highRam = true;
+1 -1
View File
@@ -1,7 +1,7 @@
{
system = "aarch64-linux";
role = "embedded";
tags = [ "arm" ];
tags = [ "lab" ];
host = {
username = "h";
};
+1 -1
View File
@@ -1,7 +1,7 @@
{
system = "aarch64-linux";
role = "embedded";
tags = [ "arm" ];
tags = [ "lab" ];
host = {
username = "h";
};
+1 -1
View File
@@ -1,7 +1,7 @@
{
system = "x86_64-linux";
role = "server";
tags = [ "cloud" ];
tags = [ "lab" ];
host = {
username = "username";
};
+1 -1
View File
@@ -1,7 +1,7 @@
{
system = "x86_64-linux";
role = "vm";
tags = [ "local" ];
tags = [ "lab" ];
host = {
username = "h";
};