diff options
author | Manuel Palenzuela <manuelpalenzuelamerino@gmail.com> | 2022-06-20 18:10:33 +0200 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-06-20 18:10:33 +0200 |
commit | 9a87c1030f6a711960789a824212d6c7a5300aba (patch) | |
tree | a91e219c84f51045684d1da515af8d3651d8f744 | |
parent | Move specialArgs to its own variable in mkHost (diff) | |
download | nixos-config-9a87c1030f6a711960789a824212d6c7a5300aba.tar.gz nixos-config-9a87c1030f6a711960789a824212d6c7a5300aba.tar.bz2 nixos-config-9a87c1030f6a711960789a824212d6c7a5300aba.zip |
Change how the mkHost function is applied, generate set dynamically
Diffstat (limited to '')
-rw-r--r-- | hosts/default.nix | 15 |
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) |