From ee17bccd5bdfc3fdd7871b0039d6c0e44dccaa70 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 4 Dec 2022 15:10:28 +0800 Subject: [PATCH] config: properly configure automatically imported nodes --- flake.nix | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/flake.nix b/flake.nix index 5e330977..f0bacc48 100644 --- a/flake.nix +++ b/flake.nix @@ -449,21 +449,30 @@ # 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, activation ? prefix, environments, system ? defaultSystem }: - lib'.mapAttrs' - (name: value: - lib'.nameValuePair "${prefix}-${name}" { - hostname = name; - profiles.system = { - sshUser = "admin"; - user = "root"; - path = inputs.deploy.lib.${defaultSystem}.activate."${activation}" value; - remoteBuild = true; - }; + nixosConfigurations = lib'.mapAttrs' + (name: value: + lib'.nameValuePair "nixos-${name}" { + hostname = name; + fastConnection = true; + profiles.system = { + sshUser = "admin"; + user = "root"; + path = inputs.deploy.lib.${defaultSystem}.activate.nixos value; + }; }) - environments; - in (importNodes { prefix = "nixos"; environments = self.nixosConfigurations; }) - // (importNodes { prefix = "home-manager"; environments = self.homeManagerConfigurations; }); + self.nixosConfigurations; + homeManagerConfigurations = lib'.mapAttrs' + (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 # are for deploy nodes.