From 69012c9f6f76b7f5aea997fd25778218c00a52ec Mon Sep 17 00:00:00 2001 From: vkcku Date: Mon, 1 Jun 2026 11:45:00 +0530 Subject: infra: autoregister nixos configurations for hosts monorepo-revid: 229cb3910cb3ee878d079c0d4ff3dc98aa80a44a --- infra/hosts/hosts.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 infra/hosts/hosts.nix (limited to 'infra/hosts/hosts.nix') 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); +} -- cgit v1.3.1