Move the previous `default.nix` to `main.nix` so that `default.nix` can
be used for defining the set of all test derivations.
`main.nix` is imported by `default.nix`, but is only responsible for the
tests built from `tests/test-sources/`.
This minimal implementation allows `nixpkgs.pkgs` to be defined, but
does not implement evaluating an instance from a pkgsPath when _not_
defined.
The `defaultPkgs` specialArg is dropped in favour of `nixpkgs.pkgs`
being defined. If it's not defined, an assertion is thrown.
In the future, a nixpkgs source path can be supplied, defaulting to the
flake's `inputs.nixpkgs`. Along with other `nixpkgs.*` options, this
will allow a `pkgs` instance to be evaluated within the module eval.
In the two places where our "helpers" lib is exclusively internal
(flake module args and building the docs), we no longer supply `pkgs`.
In the other 4 locations, we now note why we still do in a comment.
Splits everything that depends on a `pkgs` instance into an optional
attrs, allowing `helpers.nix` to be bootstrapped without `pkgs`.
This required some refactoring:
- `modules.specialArgs` is only available when `pkgs` is used
- `modules.specialArgsWith` now requires `defaultPkgs` be provided
- `builders.*` now have `*With` variants that take `pkgs` as an argument
and a `withPkgs` function that returns the old interface
- Had to define the fixed part of `builders` outside the attrs for now,
to avoid infinite recursion.
- The old `builders` are now deprecated, and print a warning when
evaluated
- `withOptoinalFns` was introduced to merge the optional attrs into the
final lib.
The old `default.nix` is inlined into the "lib" flake-module, which is
the only place it was used.
This allows "helpers" to take its rightful place at the root of `./lib` 👑
Add support for automatically importing any directories under
`plugins/by-name`.
Includes a validation test, which is run by CI and by the pre-commit hook.
The test ensures "package" options use a "literalExpression" in their
defaultText; i.e. it validates `lib.mkPackageOption` was used to build
the package options.
All options whose `default` is a derivation are covered by the test,
other than submodule sub-options.
Ensure `mkTestDerivationFromNixvimModule` correctly test warnings & assertions.
Also did some minor cleanup:
- Call `failing-tests.nix` using `pkgs.callPackage`
- Replace repetive use of `testBuildFailure` with a wrapper
`mkFailingNixvimTest`
Adds a regression test for #2076. This test ensures that
`extraConfigLua` is used in `finalPackage` and that the test will fail
correctly when running `nvim` results in unexpected output.
I have been using this more and wanted to create some filters to
onlyoutput the information I cared about. This adds the ability to
filter bykind, state, and whether a plugin has deprecation warnings.
Introduces the `test.runNvim` module option.
Deprecates the historic `dontRun` argument passed to the test-derivation
helpers.
Soft-deprecates the `tests.dontRun` attr used in tests currently.
Use a consistent behavior of getopt in launchtests.sh. Wasn't able to
use tests command on macbook without including this because the macOS
getopt didn't support our usage.
This commit adds support for byte compiling lua configuration files.
It's enabled by default (if byte compiling is enabled at all) and can be
disabled with `performance.byteCompileLua.configs` toggle.
To implement this feature `extraFiles.<name>.finalSource` internal
read-only option is introduced. `source` option cannot be used because
it's user configurable. In order to access the values of the
`performance.byteCompileLua` options, parent config is added to
specialArgs of extraFiles submodule. Then the usages of `source` option
changed to `finalSource` in all relevant places (filesPlugin and
wrappers).
Added more helpers for various cases of byte compiling:
* `byteCompileLuaFile` byte compiles lua file
* `byteCompileLuaHook` is a setup hook that byte compiles all lua files
* `byteCompileLuaDrv` overrides derivation by adding byteCompileLuaHook
to it
Added tests to validate that extraFiles specified by various methods are
handled correctly. Added a separate home-manager test, that is intended
to validate that extraFiles propagated to wrapper modules are correctly
byte compiled.
This moves most assertions out of generate-files and into a check
derivation. This should allow the CI to finish, even when there are
issues.
This also properly tests efmls, which was only checked partially before.
rust-analyzer is not covered because the existing assertions relate more
to edge-cases not handled by the generation script than the result it
builds.