aboutsummaryrefslogtreecommitdiff
path: root/infra/hosts
diff options
context:
space:
mode:
authorvkcku <[email protected]>2026-06-01 11:45:00 +0530
committervkcku <[email protected]>2026-06-01 11:45:00 +0530
commit69012c9f6f76b7f5aea997fd25778218c00a52ec (patch)
tree912b1c6bf34eba90add1aa9ae548a8e62cb3c1db /infra/hosts
parentroot: add flake-parts flake modules (diff)
infra: autoregister nixos configurations for hosts
monorepo-revid: 229cb3910cb3ee878d079c0d4ff3dc98aa80a44a
Diffstat (limited to 'infra/hosts')
-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);
+}