Commit graph

44 commits

Author SHA1 Message Date
Matt Sturgeon
d7df583211
docs: eval modules without access to pkgs
Replace the `package-options` test with a stricter implementation.

When evaluating modules for use in the docs, provide them with a stubbed
`pkgs` instance that throws an error whenever a package is evaluated.

This ensures we don't accidentally use any packages in defaults or
examples.
2025-01-25 19:16:09 +00:00
Matt Sturgeon
30842191e0
docs: enable warningsAreErrors 2025-01-17 03:56:59 +00:00
Matt Sturgeon
4b3b67fb6f
lib: make overrideable & access via flake
Add a non-system specific `<flake>.lib.nixvim` output, which is
equivalent to the existing `<flake>.lib.<system>.helpers` output.

This is now also wrapped with `lib.makeOverridable` to allow overriding
the function args used to construct the nixvim-lib.

Consistently access nixvim-lib via the new flake output, overriding
where necessary.
2024-12-21 15:17:43 +00:00
Matt Sturgeon
cdbda982f0
docs/search: refactor to use override 2024-11-18 17:53:47 +00:00
Matt Sturgeon
0562e519ec
docs: refactor wrapper-options docs 2024-10-21 18:36:00 +01:00
Marcel
28485b0e57
options-search: configure title 2024-10-09 00:10:41 +02:00
Matt Sturgeon
4b7a41276a
modules/nixpkgs: initial pkgs option, drop defaultPkgs specialArg
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.
2024-09-27 09:30:12 +01:00
Matt Sturgeon
cb2b76c1a9
docs/home-manager: eval options without checking config definitions
By default `lib.evalModules` will check all config definitions match
a declared option (or a freeform type), leading to errors like:

    error: The option `wrapRc' does not exist.

Setting `_module.freeformType` or `_module.check` will disable this,
allowing us to evaluate the option declaration without checking the
config definitions.
2024-09-27 02:56:28 +01:00
Matt Sturgeon
1116ae6332
docs: use evalNixvim helper 2024-09-22 18:18:05 +01:00
Matt Sturgeon
191b0a9502
treewide: avoid passing pkgs to our lib
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.
2024-09-22 18:18:05 +01:00
Matt Sturgeon
7a147234f8
lib: rename helpers.nix -> default.nix
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` 👑
2024-09-13 17:25:17 +01:00
Quentin Boyer
8eab77b51b
docs: Support GFM style admonitions in option descriptions 2024-09-13 13:03:23 +01:00
Quentin Boyer
cab2a30ae1
docs: Create a markdown-it plugin 2024-09-13 12:59:27 +01:00
Matt Sturgeon
6665521525
docs: move pkgs overlays to their own file 2024-09-13 12:26:48 +01:00
Matt Sturgeon
27a0dd435d
lib/types: simplify eitherRecursive by defining it only once 2024-09-12 14:44:54 +01:00
Matt Sturgeon
a5152c2f8e
docs: remove unused oneOfRecursive 2024-09-12 13:00:03 +01:00
Matt Sturgeon
d0c0821245
docs: patch nixos-render-docs to output GFM alerts
This does not add support for _using_ GFM syntax alerts, the nixpkgs
syntax must still be used in option descriptions for now.
2024-09-10 17:46:44 +01:00
Matt Sturgeon
70e9532ec2
docs: fix typo in pkgs arg default value 2024-08-28 05:45:29 +01:00
Matt Sturgeon
0bc1699037
docs: call evalModules in one place 2024-08-02 14:38:38 +01:00
Matt Sturgeon
27c4c9c210
lib/modules: init with specialArgs helpers 2024-08-02 14:38:38 +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
traxys
42a7676d5a docs: Add an option search to our documentation 2024-07-25 14:00:35 +00:00
Matt Sturgeon
8b9ba44195
flake: remove getHelpers function 2024-07-08 16:24:07 +01:00
Matt Sturgeon
04a255ed7e
modules/context: init with isDocs
Replaced the `isDocs` specialArg added in #1807 with an internal module
option.

We should only use `specialArgs` when absolutely necessary, a module or
`_module.args` is preferred, but those aren't available until `config`
is evaluated so they can't be used for `imports`.

The main problem with `specialArgs` is it makes our modules less
portable.

Luckily that shouldn't be an issue for these context flags.
2024-07-06 11:47:41 +01:00
Matt Sturgeon
edc8602d47
docs: use pkgsDoc to build helpers 2024-07-06 00:32:42 +01:00
Matt Sturgeon
38d43a740f
modules/files: don't include modules in the docs
This means we no longer need to spoof the module in the docs implementation.

Instead, we supply the (optional) special arg `isDocs` to `evalModules`.
2024-07-05 17:38:46 +01:00
Matt Sturgeon
2deb61f6a5
modules/top-level: move out of wrappers/modules 2024-07-05 17:20:28 +01: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
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
traxys
62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
traxys
6d1ef5864b
docs: Add a section on module specific options (#1355)
This commit only adds Home-Manager specific options, we should add
sections for the different kind of modules too.

This is _not_ added to the man docs, as it is more complex. If need
arises we could look into how to do it.
2024-03-30 14:52:32 +01:00
Matt Sturgeon
da7c6c41ef
docs: fix github link branch (#1300)
Nixvim uses "main" rather than "master".
2024-03-22 13:00:43 +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
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
traxys
ca30f8ddac
docs: Add wrapper specific options (#1009)
(Fixes #1002)
2024-02-03 17:45:53 +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
wolbyte
6efbb5353c docs: terminate build on shell-script error 2023-09-09 17:51:52 +02:00
wolbyte
26b202828f docs: remove whitespaces from filepaths if any 2023-08-30 15:36:44 +02:00
wolbyte
1cc77f4252 docs: ignore option aliases 2023-08-24 13:30:35 +02:00
Wolbyte
ecd593386f
docs: New documentation using mdbook (#471)
* docs: mdbook init

* Separate sub-options into their section

* docs: enable fold

* docs: merge core options into a single section

* doc generation: fix submodules index pages

* docs: add contributing section

* docs: rename 'core' group to 'Neovim Options'

docs: removed the index pages of empty sections

docs: remove obsolete 'mergeFunctionResults' function

* docs: use nix syntax highlighting

* docs: point to the new repo url

* docs: use recursive generation
docs: split submodules into subsections

* docs: fix contributing separator
docs: fix missing submodules docs
2023-08-07 11:48:01 +02:00
Pedro Alves
dd9ec124a2 docs: fix documentation generation 2022-12-29 17:34:54 +00:00
Pedro Alves
4ddd3969e5
nixvim: support standalone nixvim
This represents a major rearchitecture for nixvim, so I'm leaving this up to track the progress for now, and to serve as a reference for any breaking changes during transition.

The main change is, of course, being able to use nixvim standalone. To do this, you should use the new build function, which takes in two arguments: the system architecture (e.g. x86_64-linux) and the configuration. For the new configuration, do not use the programs.nixvim. prefix.

For module development, the main change is that you should no longer prefix your modules with programs.nixvim..
2022-09-18 11:19:23 +01:00
Pedro Alves
929659b7a1 airline: complete documentation 2022-01-12 12:42:12 +00:00
Pedro Alves
eef84178ab docs: Add basic documentation system based on nmd
You can now run `nix build '.#docs'` to build HTML documentation
documenting every single option on nixvim! Fortunately, thanks to
the 'description' field, most options are already documented, but
there are still a fair few that need documenting.

I will be taking care of those in the next few days. When those are
done, I will find a way to automatically rebuild documentation on every
repo push, and also add a PR hook requiring documentation.

Additionally, I will try to find a way to have per-page plugin docs.
2022-01-12 01:44:51 +00:00