feat(hive): Add serverNodes to the arguments

This commit is contained in:
Tom Hubrecht 2024-12-08 22:31:14 +01:00
parent 25eee32a22
commit 6d03c084a0
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
3 changed files with 10 additions and 8 deletions

View file

@ -122,9 +122,12 @@ in
evalConfig = args: import "${args.specialArgs.sourcePkgs.path}/nixos/lib/eval-config.nix" args;
defaults =
{
lib,
name,
nodes,
nodeMeta,
nodePath,
meta,
sourcePkgs,
...
}:
@ -138,6 +141,10 @@ in
./modules/${category name}
];
_module.args.serverNodes = lib.filterAttrs (
name: _: meta.nodes.${name}.nixpkgs.system == "nixos"
) nodes;
# Include default secrets
age-secrets.sources = [ ./${nodePath}/secrets ];

View file

@ -1,15 +1,13 @@
{
config,
lib,
meta,
nodes,
serverNodes,
sources,
...
}:
let
inherit (lib)
concatLists
filterAttrs
mapAttrsToList
mkForce
mkMerge
@ -22,8 +20,6 @@ let
probesWithTag
;
serverNodes = filterAttrs (name: _: meta.nodes.${name}.nixpkgs.system == "nixos") nodes;
probesCfg = config.statelessUptimeKuma.probesConfig;
mkMonitors = name: builtins.attrNames (probesWithTag { inherit name; } probesCfg);

View file

@ -1,7 +1,6 @@
{
config,
meta,
nodes,
serverNodes,
lib,
...
}:
@ -20,7 +19,7 @@ let
host = node;
};
}
) (lib.filterAttrs (name: _: meta.nodes.${name}.nixpkgs.system == "nixos") nodes)
) serverNodes
);
in