config: properly configure automatically imported nodes

This commit is contained in:
Gabriel Arazas 2022-12-04 15:10:28 +08:00
parent f90379aa4d
commit ee17bccd5b

View File

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