per-system derivations for hydra agg job
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
f5dc1046eb
commit
dbc4378f90
@ -161,7 +161,7 @@
|
||||
rec {
|
||||
inherit lib; # for allowing use of custom functions in nix repl
|
||||
|
||||
hydraJobs = import ./hydra/jobs.nix { inherit inputs outputs; };
|
||||
hydraJobs = import ./hydra/jobs.nix { inherit inputs outputs systems; };
|
||||
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
|
||||
|
||||
nixosConfigurations = genSystems inputs src (src + "/systems");
|
||||
|
@ -1,27 +1,45 @@
|
||||
{ inputs, outputs }:
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
systems,
|
||||
}:
|
||||
let
|
||||
inherit (inputs.nixpkgs.lib) mapAttrs mapAttrsToList;
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
|
||||
|
||||
getCfg = _: cfg: cfg.config.system.build.toplevel;
|
||||
hostToAgg = _: cfg: cfg;
|
||||
|
||||
# get per-system check derivation (with optional postfix)
|
||||
mapSystems =
|
||||
{
|
||||
check,
|
||||
postfix ? "",
|
||||
}:
|
||||
(map (system: if postfix == "" then check.${system} else check.${system}.${postfix}) systems);
|
||||
in
|
||||
rec {
|
||||
inherit (outputs) formatter devShells checks;
|
||||
|
||||
host = mapAttrs getCfg outputs.nixosConfigurations;
|
||||
host = lib.mapAttrs getCfg outputs.nixosConfigurations;
|
||||
|
||||
hosts = pkgs.releaseTools.aggregate {
|
||||
name = "hosts";
|
||||
constituents = mapAttrsToList hostToAgg host;
|
||||
constituents = lib.mapAttrsToList hostToAgg host;
|
||||
};
|
||||
|
||||
devChecks = pkgs.releaseTools.aggregate {
|
||||
name = "devChecks";
|
||||
constituents = [
|
||||
formatter.x86_64-linux
|
||||
devShells.x86_64-linux
|
||||
checks.x86_64-linux
|
||||
constituents = lib.flatten [
|
||||
(mapSystems { check = formatter; })
|
||||
(mapSystems {
|
||||
check = checks;
|
||||
postfix = "pre-commit-check";
|
||||
})
|
||||
(mapSystems {
|
||||
check = devShells;
|
||||
postfix = "default";
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user