tests: aggregate all test derivations into one using a linkFarm

This commit is contained in:
Gaetan Lepage 2024-01-04 22:02:23 +01:00 committed by Gaétan Lepage
parent 10d114f5a6
commit 6c3f97ccc0
2 changed files with 46 additions and 36 deletions

View file

@ -12,18 +12,29 @@
inherit lib pkgs;
root = ./test-sources;
};
in
exampleFiles = {
example = let
config = import ../example.nix {inherit pkgs;};
in
builtins.removeAttrs config.programs.nixvim [
# This is not available to standalone modules, only HM & NixOS Modules
"enable"
# This is purely an example, it does not reflect a real usage
"extraConfigLua"
"extraConfigVim"
];
};
# We attempt to build & execute all configurations
builtins.mapAttrs mkTestDerivation (testFiles
// {
example = let
config = import ../example.nix {inherit pkgs;};
in
builtins.removeAttrs config.programs.nixvim [
# This is not available to standalone modules, only HM & NixOS Modules
"enable"
# This is purely an example, it does not reflect a real usage
"extraConfigLua"
"extraConfigVim"
];
})
derivationList =
pkgs.lib.mapAttrsToList
(
name: path: {
inherit name;
path = mkTestDerivation name path;
}
)
(testFiles // exampleFiles);
in
pkgs.linkFarm "nixvim-tests" derivationList