about summary refs log tree commit diff
path: root/hosts/default.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hosts/default.nix15
1 files changed, 10 insertions, 5 deletions
diff --git a/hosts/default.nix b/hosts/default.nix
index 289caa5..0005227 100644
--- a/hosts/default.nix
+++ b/hosts/default.nix
@@ -32,9 +32,14 @@ let
       ];
     };
 in
-let hosts = [ "baitinq" "vm" ]; #TODO: generate from here. List to set + apply func
+let hosts = [
+  { hostname = "baitinq"; system = "x86_64-linux"; }
+  { hostname = "vm"; system = "x86_64-linux"; }
+];
 in
-{
-  baitinq = mkHost "baitinq" "x86_64-linux";
-  vm = mkHost "vm" "x86_64-linux";
-}
+  /*
+    We have a list of sets.
+    Map each element of the list applying the mkHost function to its elements and returning a set in the listToAttrs format
+    builtins.listToAttrs on the result
+  */
+builtins.listToAttrs (map ({ hostname, system }: { name = hostname; value = mkHost hostname system; }) hosts)