The Simulacrum: Stage 1 #108

Merged
max merged 15 commits from pr-simulacrum-stage-1 into master 2024-08-13 22:06:49 +03:00
Showing only changes of commit c1720ec30d - Show all commits

View file

@ -1,21 +1,32 @@
{ lib, ... }: { lib, ... }:
{ {
perSystem = { config, ... }: { perSystem = { config, pkgs, ... }: {
catalog.depot = { catalog = lib.mkMerge (lib.mapAttrsToList (name': check: let
checks = lib.mapAttrs (name: check: { simulacrum = lib.hasPrefix "simulacrum-" name';
description = "NixOS Test: ${name}"; name = lib.removePrefix "simulacrum-" name';
actions = { baseAttrPath = if simulacrum then
build = { [ "cluster" "simulacrum" ]
description = "Build this check."; else
command = "nix build -L --no-link '${builtins.unsafeDiscardStringContext check.drvPath}^*'"; [ "depot" "checks" ];
}; in lib.setAttrByPath (baseAttrPath ++ [ name ]) {
runInteractive = { description = if simulacrum then
description = "Run interactive driver."; "Simulacrum Test: ${name}"
command = lib.getExe check.driverInteractive; else
}; "NixOS Test: ${name}";
actions = {
build = {
description = "Build this check.";
command = "nix build -L --no-link '${builtins.unsafeDiscardStringContext check.drvPath}^*'";
}; };
}) config.checks; runInteractive = {
}; description = "Run interactive driver.";
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);
}; };
} }