nix-community.nixvim/tests/default.nix

40 lines
1 KiB
Nix
Raw Normal View History

2023-03-22 07:42:02 +01:00
{
makeNixvim,
makeNixvimWithModule,
2023-03-22 07:42:02 +01:00
lib,
helpers,
2023-03-22 07:42:02 +01:00
pkgs,
2024-05-05 19:39:35 +02:00
}:
let
2023-03-22 07:42:02 +01:00
fetchTests = import ./fetch-tests.nix;
2024-05-05 19:39:35 +02:00
test-derivation = import ./test-derivation.nix { inherit pkgs makeNixvim makeNixvimWithModule; };
2023-05-22 15:45:47 +05:30
inherit (test-derivation) mkTestDerivation;
2023-03-22 07:42:02 +01:00
# List of files containing configurations
testFiles = fetchTests {
inherit lib pkgs helpers;
2023-03-22 07:42:02 +01:00
root = ./test-sources;
};
exampleFiles = {
2024-05-05 19:39:35 +02:00
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"
];
};
2023-03-22 07:42:02 +01:00
# We attempt to build & execute all configurations
2024-05-05 19:39:35 +02:00
derivationList = pkgs.lib.mapAttrsToList (name: path: {
inherit name;
path = mkTestDerivation name path;
}) (testFiles // exampleFiles);
in
2024-05-05 19:39:35 +02:00
pkgs.linkFarm "nixvim-tests" derivationList