nixos/lib/builders.nix

28 lines
598 B
Nix
Raw Normal View History

{ nixpkgs, ... }@inputs:
let
2024-07-21 21:18:23 +00:00
lib = nixpkgs.lib.extend (import ../lib);
in
rec {
toPartialNixosConfig =
{ hostname, system }:
{
name = hostname;
value = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
../hosts/${hostname}/hardware-configuration.nix
../hosts/${hostname}/configuration.nix
inputs.home-manager.nixosModules.default
];
};
};
compileSystems =
systems:
lib.right
builtins.listToAttrs
(map toPartialNixosConfig)
systems;
}