Commit graph

83 commits

Author SHA1 Message Date
Matt Sturgeon
d3cb750e6a
update-scripts: move out of flake
See the explanation in the new update-scripts/README.md file.
2024-08-03 21:56:40 +01:00
Matt Sturgeon
8945b3b5e3
flake/generate-files: fix --commit line count
`echo` pipes all its output at once, so `wc -l` always counts 1 line.

See https://stackoverflow.com/questions/60954221
2024-07-31 14:06:49 +01:00
Stanislav Asunkin
44849233e0 modules/performance: add ability to byte compile lua configuration files
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.
2024-07-31 11:31:40 +00:00
Matt Sturgeon
3789c69658
flake/generate-files: use nixfmt directly
Running `nix fmt` is unnecessary in this case.
2024-07-31 11:49:28 +01:00
Matt Sturgeon
0b23a4ce85
flake/generate-files: do all builds in one eval 2024-07-31 11:49:28 +01:00
Matt Sturgeon
fc8155b5fa
tests/generated: init by checking declared tools
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.
2024-07-31 11:49:28 +01:00
Quentin Boyer
c12e59ff7c doc: Use correct href for nuscht-search
This commit also adds a subdirectory in the docs derivation, to have the
same local structure than what is uploaded on github pages.
2024-07-25 18:23:47 +00:00
Quentin Boyer
4d874f6c11 dev: Make the serve-docs command uncached 2024-07-25 14:00:35 +00:00
traxys
42a7676d5a docs: Add an option search to our documentation 2024-07-25 14:00:35 +00:00
traxys
f1eaf5b617 dev: Allow to pass arguments to nix in tests
This can allow to pass --show-trace for example
2024-07-23 22:03:42 +02:00
traxys
1c75b414cb dev: Allow to choose the system in tests
This is done through the -s/--system <system> option
2024-07-23 21:58:23 +02:00
Gaetan Lepage
901e8760d0 flake-modules/dev: format launch-test.sh 2024-07-22 23:25:28 +02:00
traxys
7908729711 dev: Make the tests command able to select which test to launch
The `tests` command can either launch all tests (without any arguments),
a specific test with `-t/--test` or choose a test with `-i/--interactive`
2024-07-21 15:17:17 +02:00
traxys
b1576362a7 tests: Remove the test link farm
Fixes #1878
2024-07-21 15:17:17 +02:00
Matt Sturgeon
c1feceda64
dev: fix --commit when the worktree is dirty 2024-07-15 12:11:28 +01:00
Matt Sturgeon
4f3cd9f368
plugins/none-ls: combine packaged+unpackaged lists
We can just make `packaged` nullable again.
2024-07-13 20:20:46 +01:00
Gaetan Lepage
ca01a644ef flake/dev/formatting: run ruff format in isolated mode 2024-07-11 14:59:08 +02:00
Matt Sturgeon
34c3c026b4
tests: add check for nixpkgs maintainers
The test fails if a nixvim maintainer is also a nixpkgs maintainer.
2024-07-10 09:18:18 +01:00
Matt Sturgeon
7e3d629bb0
flake/generate-files: add --commit command + fixes
- Added `--commit` with a git-based message
- `nix fmt` only operates on files known to git
- ensure `generated` directory exists
2024-07-10 08:30:03 +01:00
Matt Sturgeon
aad2e32b5a treewide: reformat 2024-07-08 16:24:47 +00:00
Matt Sturgeon
3c786ae988 flake: ignore unformatted files
This suppresses treefmt's "no formatter for path" warnings.
2024-07-08 16:24:47 +00:00
Matt Sturgeon
f1a0cf3a90 flake: format toml using "taplo" 2024-07-08 16:24:47 +00:00
Matt Sturgeon
2339ddc3a0 flake: format lua with "stylua" 2024-07-08 16:24:47 +00:00
Matt Sturgeon
b310affef3 flake: format + lint python with "ruff" 2024-07-08 16:24:46 +00:00
Matt Sturgeon
7c02148e68 flake: format JS & YML with "prettier"
Used for JS and YML files.
Markdown is excluded.
2024-07-08 16:24:46 +00:00
Matt Sturgeon
2583f54225 flake/pre-commit: use treefmt in git hook 2024-07-08 16:24:46 +00:00
Matt Sturgeon
8b9ba44195
flake: remove getHelpers function 2024-07-08 16:24:07 +01:00
Matt Sturgeon
1b7efacdf4
wrappers: bootstrap "helpers" directly
We don't need to pass a `getHelpers` function in, since we can just
import `../lib/helpers.nix`.
2024-07-08 16:24:06 +01:00
seth
5feeb4eef8
flake/dev: make treefmt-nix optional
as this isn't used by consumers, they should be able to remove this
input via `inputs.nixvim.inputs.treefmt-nix.follows = ""`
2024-07-07 16:05:50 -04:00
seth
432a513ccd
flake/dev: make git-hooks optional
as this isn't used by consumers, they should be able to remove this
input via `inputs.nixvim.inputs.git-hooks.follows = ""`. it is
especially important here as `git-hooks` has a large amount of inputs
itself
2024-07-07 16:05:04 -04:00
seth
2f21379b8c
flake/devshell: make devshell optional
as this isn't used by consumers, they should be able to remove this
input via `inputs.nixvim.inputs.devshell.follows = ""`
2024-07-07 16:04:31 -04:00
Matt Sturgeon
f11f991e09
flake/checks: test extraFiles are in the build 2024-07-07 16:43:06 +01:00
Matt Sturgeon
edc8602d47
docs: use pkgsDoc to build helpers 2024-07-06 00:32:42 +01:00
traxys
8fbcfcb469 dev: Move assert in derivation for generated file in the derivation definition
If we access the asserts outside the derivation arguments, and inside
the code that _creates_ the derivation then we observe IFD in `nix flake
show`.

This commit fixes it, and allows `nix flake show` to work!

Fixes #1154
2024-07-05 21:53:05 +02:00
traxys
0b93815db5 dev: Add a script to generate the none-ls builtins 2024-07-05 21:36:45 +02:00
traxys
c1231826b9 dev: Add a script to generate efmls-configs tools 2024-07-05 16:57:03 +02:00
traxys
668894b6d3 github: Re-generate the files on updates 2024-07-05 13:34:44 +02:00
traxys
8b6b2e5253 dev: Add a script to generate rust-analyzer options 2024-07-05 13:34:44 +02:00
Matt Sturgeon
d2afb176ff
modules: refactor module bootstrapping
Let's simplify things by defining all modules in `./plugins`, `./modules`
and `./wrappers/modules`.

Instead of currying `pkgs` into a bootstrapping module, we can require
`defaultPkgs` be provided as a special arg.

This refactor allows us to completely remove `flake-modules/modules.nix`!
2024-07-02 19:58:30 +01:00
Matt Sturgeon
714aa7bb18
flake/devshell: add test-lib command + improve checks 2024-06-30 17:53:35 +01:00
Matt Sturgeon
c062b976ef
flake/legacyPackages: simplify makeNixvim, making it more powerful
Rather than nesting it as `config`, pass `makeNixvim`'s argument through
directly as a module.

This not only simplifies the implementation, but allows users to use
`makeNixvim` for any scenario where `makeNixvimWithModule` would normally
be required.
2024-06-29 22:15:45 +01:00
Matt Sturgeon
10f64e6c96
tests/test-derivation: allow tests to be modules
Use `mkTestDerivationFromNixvimModule` instead of `mkTestDerivation`,
allowing "proper" modules to be used instead of plain attr configs.

This is useful for more complex tests that wish to use `config` or
`options` arguments, e.g:

```nix
{config, options, ...}: {
  /* some cool test */
}
```

To allow `tests.dontRun` to be defined on such a test, the module is
allowed to be nested as `module`, e.g:

```nix
{
  tests.dontRun = true;
  module = {config, options, ...}: {
    /* a disabled test */
  };
}
```

Also ended up doing some general cleanup, removing an unused function,
etc.
2024-06-29 22:02:44 +01:00
PerchunPak
0957f5fd89
flake/dev: fix nix-output-monitor
- Bash resolves `'${VAR:-0}'` as literal string `'${VAR:-0}'`, instead
we want a value from `$VAR`.
- Proper package name for NOM is `nix-output-monitor`, not `nom`.
2024-06-27 18:34:55 +02:00
Gaetan Lepage
744dfea48b flake/dev: add list-plugins script/command 2024-06-20 09:47:52 +02:00
Matt Sturgeon
f34fda8d99
meta: extend meta.nixvimInfo support treewide
Rather than supplying a `kind` and `name` pair, we now supply a raw
path.

This path could point to any nixvim option.
2024-06-07 22:22:55 +01:00
Sefa Eyeoglu
aa4afbeac2
docs: use lib.extend instead of patching nixpkgs
This speeds up evaluation and removes IFD. Additionally, this makes it
easier to maintain these library changes, as we don't have to maintain
static patches.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2024-06-06 11:13:52 +01:00
Matt Sturgeon
a54ee8ad64
flake-modules: explicitly set the same nixfmt for treefmt + pre-commit 2024-06-05 09:09:08 +01:00
Matt Sturgeon
d9789956d9
flake-modules: don't explicitly set treefmt package 2024-06-05 09:09:07 +01:00
Matt Sturgeon
4d1d008e78
flake-modules: treefmt is formatter by default
Remove explicit `formatter = config.treefmt.build.wrapper`, because treefmt's `flakeFormatter` option (default `true`) handles that for us.
2024-06-05 09:09:07 +01:00
Matt Sturgeon
ec78d2e1ab
flake-modules: drop flake-root
treefmt isn't actually using flake-root to find the flake's root; it
does it itself.

All we were doing was passing flake-root's default `projectRootFile` to
treefmt, which is `"flake.nix"`;
2024-06-05 09:09:07 +01:00