26 lines
769 B
Nix
26 lines
769 B
Nix
{ nixpkgs, ... }@inputs:
|
|
rec {
|
|
generateNixosSystem = name: {
|
|
system ? "x86_64-linux",
|
|
group ? null,
|
|
modules ? [],
|
|
site
|
|
}: let
|
|
localNixpkgs = nixpkgs.lib.attrByPath [ "nixpkgs-${name}" ] nixpkgs inputs;
|
|
in localNixpkgs.lib.nixosSystem {
|
|
system = system;
|
|
modules = modules ++ [
|
|
./configuration/common
|
|
./configuration/proxmox-vm
|
|
./configuration/proxmox-vm/hardware-configuration.nix
|
|
./hosts/${name}
|
|
];
|
|
};
|
|
|
|
mapToNixosConfigurations = name: host: generateNixosSystem name host;
|
|
|
|
filterUnderscore = hosts: (nixpkgs.lib.filterAttrs (name: host: (builtins.substring 0 1 name) != "_") hosts);
|
|
|
|
buildHosts = hosts: builtins.mapAttrs (name: host: host.config.system.build.toplevel) (filterUnderscore hosts);
|
|
}
|