Commit graph

109 commits

Author SHA1 Message Date
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
Sizhe Zhao
db32a4ebda
flake-modules/wrappers: add default module 2024-06-01 00:01:27 +08:00
Gaetan Lepage
1b892d0784 flake: rename pre-commit-hooks to git-hooks 2024-05-27 13:24:07 +02:00
Gaetan Lepage
f7f255afe2 flake-modules: add treefmt to fix the 'nix fmt' command 2024-05-07 22:52:27 +02:00
traxys
62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
traxys
c6281260dc flake-modules: Use nixfmt instead of alejandra 2024-05-05 22:00:40 +02:00
Gaetan Lepage
848543d527 docs: optionally add a description to plugins 2024-03-22 13:15:41 +01:00
Loïc Reynier
233feeb8d2
treewide: fix typos (#1217) 2024-03-07 19:44:13 +01:00
Gaetan Lepage
5293373732 flake/devshell: remove "$@" in 'checks' as it doesn't work 2024-03-06 10:19:42 +01:00
Gaetan Lepage
8b0eba515d flake/devshell: forward cli args to commands 2024-03-04 11:45:36 +01:00
Gaetan Lepage
274293fd69 flake/dev: add a convenient devshell 2024-03-02 14:51:00 +01:00
traxys
9cd3721adf
standalone: Allow to extend a standalone derivation with a new module (#1142)
This adds the `nixvimExtend` attribute to the generated standalone
derivation, this attribute takes a module as an argument and returns a
new standalone derivation with the initial module & the extended module
merged together.
2024-02-22 08:22:21 +01:00
traxys
82a24d0d42
docs: Allow to add an url in the online documentation (#1139)
* plugin/committia: Use correct maintainers import

* plugins/neocord: Remove redyf as the entry is not in the list

* docs: Allow to add an URL to the plugin
2024-02-20 21:20:59 +01:00
traxys
dcbe894bea
Fix issue with non flake import (#1102)
* Update flake compat

* tests: Add a test without flakes
2024-02-15 22:51:26 +01:00
traxys
6d7e429537
tests: Introduce a way to disable options when running in tests (#1095)
In our basic template we used to provide a check based on
`mkTestDerivationFromNvim`. The issue with this check (that is handled
correctly internally) is that some plugins _can't_ be used in the test
environment, for example image.nvim like in #1085.

This commit introduces a new function to generate such checks,
`mkTestDerivationFromNixvimModule`, that wraps a nixvim configuration
instead of a built nvim instance.

Then a configuration can rely on the newly added
`helpers.enableExceptInTests` attribute to disable parts of the
configuration depending if it is evaluated in tests or in a real final
configuration.

Resolves #1085
2024-02-15 14:27:45 +01:00
Gaetan Lepage
a121d96091 tests: do not import helpers.nix directly 2024-02-11 11:50:35 +01:00
Gaetan Lepage
5d3ed3a09e misc: refactor helpers propagation
Co-authored-by: Robert Hensing <robert@roberthensing.nl>
2024-02-09 14:20:25 +01:00
Gaetan Lepage
eec8d6b1b2 misc: import nixvim modules in a simpler way 2024-02-09 08:15:13 +01:00
traxys
507ff5b142
docs: Use a nixpkgs patch instead of copy/pasting nixpkgs functions (#1011)
This makes the code more maintainable, as it only depends on our small
patch, instead of a large number of internals of nixpkgs.
2024-02-03 19:04:09 +01:00
Gaetan Lepage
df7a90127b flake: use unfree nixpkgs to build documentation 2024-01-18 13:45:23 +01:00
traxys
29225c2797
docs: Correctly generate documentation for types either a (submodule ...) (#929)
This requires pulling quite a lot of code from nixpkgs in order to
make the `either` type work correctly, the effects can be seen for
example in the documentation of `ollama.promps` and `ollama.actions`
2024-01-12 23:22:03 +01:00
Gaetan Lepage
ed02648368 flake/wrappers: move wrappers checks to wrappers.nix 2024-01-06 18:20:46 +01:00
traxys
2167c1930c
tests: Add a test for nix-darwin modules (#909) 2024-01-06 18:03:44 +01:00
traxys
245930d735
tests: Add a test for the nixos module (#907) 2024-01-06 17:53:31 +01:00
traxys
96cdbc8177
tests: Add a test for the home-manager module (#901) 2024-01-06 17:31:17 +01:00