nixos-servers/nix/flake/nixos.nix
2024-03-19 22:56:52 +01:00

29 lines
766 B
Nix

{ nixpkgs, nixpkgs-unstable, machines, physicalMachines, dns, microvm, disko, agenix, nixos-hardware, kubenix, ... }:
let
mkNixosSystems = systemDef:
builtins.mapAttrs
(name: machine:
nixpkgs.lib.nixosSystem (systemDef name machine)
)
physicalMachines;
in
{
nixosConfigurations = mkNixosSystems (name: machine: {
system = machine.arch;
specialArgs = { inherit nixpkgs-unstable machines machine dns microvm disko agenix nixos-hardware kubenix; };
modules = [
../.
{ networking.hostName = name; }
{
nixpkgs.overlays = [
(final: _prev: {
unstable = import nixpkgs-unstable {
system = machine.arch;
};
})
];
}
];
});
}