mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
30 lines
745 B
Nix
30 lines
745 B
Nix
{ path, nixosModule, unstable, ... }@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; })
|
|
(_: {
|
|
nixpkgs.overlays = [
|
|
(_: _: {
|
|
unstable = import unstable {
|
|
inherit (hostMeta) system;
|
|
config.allowUnfree = true;
|
|
};
|
|
})
|
|
];
|
|
})
|
|
];
|
|
};
|
|
|
|
in
|
|
builtins.mapAttrs getHostConfig hostMetadata
|