Commit graph

144 commits

Author SHA1 Message Date
amalgame21
aaecda1471 docs: fix typo in standalone.md (makeNixvimWithModule) 2024-10-06 18:38:33 +00:00
Fred Drake
d42c804ad5 config-examples: add fred-drake 2024-10-05 21:05:51 -04:00
Zain Kergaye
846e1a321a config-examples: add zainkergaye 2024-10-02 06:54:03 +00: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
79010edc14
docs/user-guide: update "not found in pkgs" FAQ
Since starting to use `lib.mkPackageOption` throughout nixvim, users
will see a slightly different error message when encountering mismatched
nixpkgs channel errors.

Also fleshed out some recommendations.
2024-09-10 13:46:24 +01:00
traxys
faa2e6306c docs: Render alerts using mdbook-alerts
Closes #1791
2024-09-10 08:17:21 +00:00
Austin Horstman
ff042dfc93
docs/mdbook: cleanup with lib 2024-09-03 22:12:33 -05:00
Matt Sturgeon
285f6cbd7b
lib/*-plugin: use lib.mkPackageOption internally
Instead of maintainers providing an actual `defaultPackage`, they should
specify the pkg name which we'll use when calling `lib.mkPackageOption`.

This makes `mkVimPlugin` and `mkNeovimPlugin` compliant with #1950.
2024-09-04 03:07:49 +01:00
Matt Sturgeon
70e9532ec2
docs: fix typo in pkgs arg default value 2024-08-28 05:45:29 +01:00
Austin Horstman
052ee66dbb
docs/mdbook: move description to bottom
Long descriptions for plugins will shove the plugin's source link and
maintainer information far down the page. Since those are fairly short
and the description is a variable size. Moving below to maintain
consistent placement.
2024-08-23 15:07:21 -05:00
Matt Sturgeon
511a328aa3
wrappers: add our lib to the host's _module.args
Make our "extended" lib available to host modules as `_module.args.nixvimLib`.

We didn't do this before because `helpers` was too generic of a name,
but `nixvimLib` should be ok.

    { nixvimLib, ... }: {
        programs.nixvim.someOption = nixvimLib.nixvim.mkRaw "print('Hi')";
    }
2024-08-22 13:19:59 +01:00
Matt Sturgeon
e555ba13b1
docs/helpers: document the "extended" lib 2024-08-22 13:19:59 +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
Austin Horstman
59941a5300
config-examples: fix typo 2024-07-27 15:14:06 -05:00
Austin Horstman
686507a4cb
config-examples: add khanelivim 2024-07-27 15:14:06 -05: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
216d64c158
wrappers: make helpers available via lib option
NixOS, HM, & Darwin provide a `lib` option, not to be confused with the
`lib` module arg.

This option is intended for modules to define custom functions without
having to extend nixpkgs lib.

The old option is renamed, if it is accessed it will print:

    trace: Obsolete option `nixvim.helpers' is used. It was renamed to `lib.nixvim'.
2024-07-24 22:02:56 +01:00
traxys
e80a8874ac docs: Add a section of *Package options
Documents the fix for #1282

Closes #1282
2024-07-19 22:46:32 +02:00
Matt Sturgeon
aad2e32b5a treewide: reformat 2024-07-08 16:24:47 +00:00
Matt Sturgeon
8c44124a1f
docs/user-guide: fix blurb on accessing helpers
Fixes #1220
2024-07-08 16:24:07 +01: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
Matt Sturgeon
55fee7051f
standalone: rename nixvimExtend to extend
This is our scope, so there's no need to be explicit.

This also follows the precedent set by `lib.extend`, although that takes
an overlay function.
2024-07-01 15:54:29 +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
Ronnie Hounskul
155353436c Update config-examples.md 2024-06-28 07:53:52 +02:00
Jesse Martinez
35e837c10b Update config-examples.md
Adding new configuration JMartJonesy/kickstart.nixvim

Update config-examples.md

Fixed alphabetic ordering
2024-06-27 17:04:37 +02:00
Gaetan Lepage
a5bc4e645b docs/config-examples: add comment for keeping entries sorted 2024-06-27 11:38:44 +02:00
Matt Sturgeon
76a8790764
docs/mdbook: only include sub-options of visible options
E.g. rename aliases that target the `settings` option shouldn't show the
`settings` sub-options under the `visible=false` alias.
2024-06-25 17:47:38 +01:00
Matt Sturgeon
9e6d690104
docs/mdbook: simplify isVisible 2024-06-25 17:41:42 +01:00
Roel de Cort
66c8592b31 fix url
didn't render the url correctly, fixed.
2024-06-24 13:28:07 +02:00
Roel de Cort
00f77cbfd0 conform to alphabetical order
Requisted to respect the alphabetical ordering of the list.
2024-06-24 13:28:07 +02:00
Roel de Cort
d0bf018de6 Update config-examples.md with my Nixvim Config
Added my nixvim config to the list of examples
2024-06-24 13:28:07 +02:00
Nikhil Singh
6ac0d2869d docs/config-examples: add niksingh710's config 2024-06-16 23:18:17 +05:30
Matt Sturgeon
f8787bd23b
docs: capitalize URL 2024-06-13 05:46:16 +01:00