mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 12:19:07 +00:00
config: properly configure automatically imported nodes
This commit is contained in:
parent
f90379aa4d
commit
ee17bccd5b
37
flake.nix
37
flake.nix
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user