mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-11-09 18:47:02 +00:00
20 lines
464 B
Nix
20 lines
464 B
Nix
{ path, nixosModule, ... }@inputs:
|
|
let
|
|
|
|
hostMetadata = builtins.mapAttrs
|
|
(name: _: import (path + "/${name}"))
|
|
(builtins.readDir path);
|
|
|
|
getHostConfig = hostName: hostMeta:
|
|
inputs.${hostMeta.pkgs}.lib.nixosSystem
|
|
{
|
|
inherit (hostMeta) system;
|
|
modules = [
|
|
(nixosModule)
|
|
(hostMeta.module)
|
|
(_: { networking.hostName = hostName; })
|
|
];
|
|
};
|
|
|
|
in
|
|
builtins.mapAttrs getHostConfig hostMetadata
|