aboutsummaryrefslogtreecommitdiff
path: root/infra
diff options
context:
space:
mode:
Diffstat (limited to 'infra')
-rw-r--r--infra/hosts/hosts.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/infra/hosts/hosts.nix b/infra/hosts/hosts.nix
new file mode 100644
index 0000000..9e7c69f
--- /dev/null
+++ b/infra/hosts/hosts.nix
@@ -0,0 +1,24 @@
+{
+ config,
+ lib,
+ inputs,
+ ...
+}:
+{
+ flake.nixosConfigurations =
+ let
+ hosts = builtins.attrNames (
+ lib.attrsets.filterAttrs (_: type: type == "directory") (builtins.readDir ./.)
+ );
+
+ mkNixosConfiguration = host: {
+ name = host;
+ value = inputs.nixpkgs.lib.nixosSystem {
+ modules = [
+ config.flake.modules.nixos."${host}"
+ ];
+ };
+ };
+ in
+ builtins.listToAttrs (map mkNixosConfiguration hosts);
+}