logic fixed for deploy targetName resolution

This commit is contained in:
kat witch 2021-08-07 04:08:27 +01:00
parent 31857ea95b
commit ca816adbf3
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72

View file

@ -53,10 +53,11 @@ in
config = {
deploy = {
system = config.system.build.toplevel;
targetName = if (meta.deploy.targets ? ${name}) then
(mkDefault name)
else
head (attrNames ((filterAttrs(targetName: target: elem config.networking.hostName target.nodeNames) meta.deploy.targets)));
targetName = let
explicitlyDefinedHosts = concatLists (mapAttrsToList (targetName: target: remove targetName target.nodeNames) meta.deploy.targets);
in if (meta.deploy.targets.${config.networking.hostName}.enable) then
config.networking.hostName
else (head (attrNames (filterAttrs (n: v: n != config.networking.hostName && (elem config.networking.hostName v.nodeNames)) meta.deploy.targets)));
};
deploy.tf = mkMerge (singleton
{