config: fix and improve upon importNodes

This commit is contained in:
Gabriel Arazas 2022-12-01 08:21:04 +08:00
parent 9a0079a7fc
commit acfc617e10

View File

@ -449,20 +449,21 @@
# ignoring the shell entry by simply prefixing it with a space which most
# command-line shells have support for (e.g., Bash, zsh, fish).
deploy.nodes = let
importNodes = prefix: systems:
importNodes = { prefix, activation ? prefix, environments, system ? defaultSystem }:
lib'.mapAttrs'
(name: value:
lib'.nameValuePair "${prefix}-name" {
lib'.nameValuePair "${prefix}-${name}" {
hostname = name;
profiles.system = {
sshUser = "admin";
user = "root";
path = inputs.deploy.lib.${defaultSystem}.activate.nixos value;
path = inputs.deploy.lib.${defaultSystem}.activate."${activation}" value;
remoteBuild = true;
};
})
systems;
in (importNodes "nixos" self.nixosConfigurations)
// (importNodes "home-manager" self.homeManagerConfigurations);
environments;
in (importNodes { prefix = "nixos"; environments = self.nixosConfigurations; })
// (importNodes { prefix = "home-manager"; environments = self.homeManagerConfigurations; });
# How to make yourself slightly saner than before. So far the main checks
# are for deploy nodes.