packages/catalog: expose simulacrum checks differently
This commit is contained in:
parent
fe8ddd4094
commit
b848084dd8
1 changed files with 26 additions and 15 deletions
|
@ -1,10 +1,19 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
perSystem = { config, ... }: {
|
||||
catalog.depot = {
|
||||
checks = lib.mapAttrs (name: check: {
|
||||
description = "NixOS Test: ${name}";
|
||||
perSystem = { config, pkgs, ... }: {
|
||||
catalog = lib.mkMerge (lib.mapAttrsToList (name': check: let
|
||||
simulacrum = lib.hasPrefix "simulacrum-" name';
|
||||
name = lib.removePrefix "simulacrum-" name';
|
||||
baseAttrPath = if simulacrum then
|
||||
[ "cluster" "simulacrum" ]
|
||||
else
|
||||
[ "depot" "checks" ];
|
||||
in lib.setAttrByPath (baseAttrPath ++ [ name ]) {
|
||||
description = if simulacrum then
|
||||
"Simulacrum Test: ${name}"
|
||||
else
|
||||
"NixOS Test: ${name}";
|
||||
actions = {
|
||||
build = {
|
||||
description = "Build this check.";
|
||||
|
@ -12,10 +21,12 @@
|
|||
};
|
||||
runInteractive = {
|
||||
description = "Run interactive driver.";
|
||||
command = lib.getExe check.driverInteractive;
|
||||
command = if simulacrum then
|
||||
"${pkgs.bubblewrap}/bin/bwrap --unshare-all --bind / / --dev-bind /dev /dev ${lib.getExe check.driverInteractive}"
|
||||
else
|
||||
lib.getExe check.driverInteractive;
|
||||
};
|
||||
};
|
||||
}) config.checks;
|
||||
};
|
||||
}) config.checks);
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue