refactor(deploy): set up tailnet 'colmena' deploy
This commit is contained in:
+4
-3
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -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,7 +1,7 @@
|
||||
{
|
||||
system = "x86_64-linux";
|
||||
role = "desktop";
|
||||
tags = [ "local" ];
|
||||
tags = [ "personal" ];
|
||||
host = {
|
||||
username = "h";
|
||||
highRam = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
system = "x86_64-linux";
|
||||
role = "laptop";
|
||||
tags = [ "local" ];
|
||||
tags = [ "personal" ];
|
||||
host = {
|
||||
username = "h";
|
||||
highRam = true;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
system = "aarch64-linux";
|
||||
role = "embedded";
|
||||
tags = [ "arm" ];
|
||||
tags = [ "lab" ];
|
||||
host = {
|
||||
username = "h";
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
system = "aarch64-linux";
|
||||
role = "embedded";
|
||||
tags = [ "arm" ];
|
||||
tags = [ "lab" ];
|
||||
host = {
|
||||
username = "h";
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
system = "x86_64-linux";
|
||||
role = "server";
|
||||
tags = [ "cloud" ];
|
||||
tags = [ "lab" ];
|
||||
host = {
|
||||
username = "username";
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
system = "x86_64-linux";
|
||||
role = "vm";
|
||||
tags = [ "local" ];
|
||||
tags = [ "lab" ];
|
||||
host = {
|
||||
username = "h";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user