Generate hosts for hydra
This commit is contained in:
parent
10de1e428a
commit
c1a2aa1d63
5 changed files with 61 additions and 18 deletions
25
helper.nix
Normal file
25
helper.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ 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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue