refactor(deploy): move deployment config into '<host>/meta.nix'

This commit is contained in:
2026-04-21 16:43:36 +02:00
parent 6a30a431f8
commit 583b9ea5f3
12 changed files with 43 additions and 34 deletions

View File

@@ -8,19 +8,15 @@ let
utils = import ../utils { inherit lib; };
hostDirNames = utils.dirNames ../hosts;
mkNode = hostname: tags: {
mkNode = hostname: meta: {
imports = [ ../hosts/${hostname} ];
deployment = {
targetHost = self.nixosConfigurations.${hostname}.config.ssh.publicHostname;
targetUser = self.nixosConfigurations.${hostname}.config.host.username;
buildOnTarget = builtins.any (t: t != "local" && t != "arm") tags;
inherit tags;
inherit (meta.deployment) targetHost targetUser tags;
buildOnTarget = builtins.any (t: t != "local" && t != "arm") meta.deployment.tags;
};
};
nodes = lib.genAttrs hostDirNames (
hostname: mkNode hostname (utils.hostMeta ../hosts/${hostname}).deployment.tags
);
nodes = lib.genAttrs hostDirNames (hostname: mkNode hostname (utils.hostMeta ../hosts/${hostname}));
in
inputs.colmena.lib.makeHive (
{