2021-10-04 05:48:11 +00:00
|
|
|
{ path, nixosModule, ... }@inputs:
|
2021-06-05 06:22:38 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
hostMetadata = builtins.mapAttrs
|
2021-08-23 00:42:09 +00:00
|
|
|
(name: _: import (path + "/${name}"))
|
|
|
|
(builtins.readDir path);
|
2021-06-05 06:22:38 +00:00
|
|
|
|
|
|
|
getHostConfig = hostName: hostMeta:
|
2021-08-23 00:42:09 +00:00
|
|
|
inputs.${hostMeta.pkgs}.lib.nixosSystem
|
2021-06-05 06:22:38 +00:00
|
|
|
{
|
|
|
|
inherit (hostMeta) system;
|
|
|
|
modules = [
|
2021-08-23 00:42:09 +00:00
|
|
|
(nixosModule)
|
2021-06-05 06:22:38 +00:00
|
|
|
(hostMeta.module)
|
|
|
|
(_: { networking.hostName = hostName; })
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
builtins.mapAttrs getHostConfig hostMetadata
|