diff --git a/flake-modules/checks.nix b/flake-modules/checks.nix deleted file mode 100644 index bb168bf809..0000000000 --- a/flake-modules/checks.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - perSystem = { - pkgs, - config, - makeNixvimWithModuleUnfree, - makeNixvimWithModule, - ... - }: { - checks = - { - tests = import ../tests { - inherit pkgs; - inherit (pkgs) lib; - makeNixvim = configuration: - makeNixvimWithModuleUnfree { - module = { - config = configuration; - }; - }; - }; - - extra-args-tests = import ../tests/extra-args.nix { - inherit pkgs; - inherit makeNixvimWithModule; - }; - - lib-tests = import ../tests/lib-tests.nix { - inherit pkgs; - inherit (pkgs) lib; - }; - } - # Do not check if documentation builds fine on darwin as it fails: - # > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535) - // (pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) { - inherit (config.packages) docs; - }); - }; -} diff --git a/flake-modules/default.nix b/flake-modules/default.nix index 2e8997c3cd..057d6dff72 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -1,6 +1,5 @@ {inputs, ...}: { imports = [ - ./checks.nix ./dev.nix ./lib.nix ./legacy-packages.nix @@ -8,6 +7,7 @@ ./overlays.nix ./packages.nix ./templates.nix + ./tests.nix ./wrappers.nix ]; diff --git a/flake-modules/packages.nix b/flake-modules/packages.nix index dc3a777624..8d85505a54 100644 --- a/flake-modules/packages.nix +++ b/flake-modules/packages.nix @@ -7,7 +7,9 @@ ... }: { packages = let - docs = { + # Do not check if documentation builds fine on darwin as it fails: + # > sandbox-exec: pattern serialization length 69298 exceeds maximum (65535) + docs = pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) { docs = pkgsUnfree.callPackage (import ../docs) { inherit modules; }; @@ -20,5 +22,8 @@ in docs // man-docs; + + # Test that all packages build fine when running `nix flake check`. + checks = config.packages; }; } diff --git a/flake-modules/tests.nix b/flake-modules/tests.nix new file mode 100644 index 0000000000..48b55865fc --- /dev/null +++ b/flake-modules/tests.nix @@ -0,0 +1,32 @@ +{ + perSystem = { + pkgs, + config, + makeNixvimWithModuleUnfree, + makeNixvimWithModule, + ... + }: { + checks = { + tests = import ../tests { + inherit pkgs; + inherit (pkgs) lib; + makeNixvim = configuration: + makeNixvimWithModuleUnfree { + module = { + config = configuration; + }; + }; + }; + + extra-args-tests = import ../tests/extra-args.nix { + inherit pkgs; + inherit makeNixvimWithModule; + }; + + lib-tests = import ../tests/lib-tests.nix { + inherit pkgs; + inherit (pkgs) lib; + }; + }; + }; +}