refactor: merge 'host.nix' into 'meta.nix'

This commit is contained in:
2026-06-12 20:30:08 +02:00
parent c7567330b8
commit 1995c04b1d
21 changed files with 78 additions and 84 deletions

View File

@@ -8,16 +8,24 @@ let
utils = import ../utils { inherit lib; };
hostnames = utils.dirNames ../hosts;
mkNode = hostname: meta: {
imports = [ ../hosts/${hostname} ];
host.name = hostname;
deployment = {
inherit (meta.deployment) targetHost targetUser tags;
buildOnTarget = builtins.any (t: t != "local" && t != "arm") meta.deployment.tags;
mkNode =
hostname:
let
meta = utils.hostMeta ../hosts/${hostname};
isLocal = builtins.elem "local" meta.tags;
in
{
imports = [ ../hosts/${hostname} ];
host.name = hostname;
deployment = {
inherit (meta) tags;
targetUser = meta.host.username;
targetHost = if isLocal then "" else hostname;
buildOnTarget = builtins.any (t: t != "local" && t != "arm") meta.tags;
};
};
};
nodes = lib.genAttrs hostnames (hostname: mkNode hostname (utils.hostMeta ../hosts/${hostname}));
nodes = lib.genAttrs hostnames mkNode;
in
inputs.colmena.lib.makeHive (
{