Generate colmena and hydraJobs outputs from the same hosts attribute set

This commit is contained in:
fi 2023-07-31 15:03:52 +02:00
parent 5856edeb47
commit 59a7e36838
Signed by: fi
SSH key fingerprint: SHA256:d+6fQoDPMbSFK95zRVflRKZLRKF4cPSQb7VIxYkhFsA
3 changed files with 15 additions and 6 deletions

View file

@ -1,23 +1,27 @@
{ nixpkgs, nixpkgs-unstable, ... }:
let
# Set of environment specific modules
environments = {
"proxmox" = [
./configuration/proxmox-vm
./configuration/proxmox-vm/hardware-configuration.nix
];
};
#
generateDefaults = hosts: builtins.mapAttrs (name: {
hostNixpkgs ? nixpkgs,
system ? "x86_64-linux",
# pkgs is explicitly defined so that overlays for each host can easily be created
pkgs ? hostNixpkgs.legacyPackages.${system},
environment ? "proxmox",
site
}: {
inherit hostNixpkgs system pkgs environment site;
# define common and host modules and additionally add environment specific modules
modules = [
./configuration/common
./hosts/${name}
] ++ (if environments ? ${environment} then environments.${environment} else []);
] ++ environments.${environment};
}) hosts;
in
generateDefaults {