1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-12-08 18:11:07 +01:00

docs: discourage use of follows

Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
saygo-png 2025-12-05 17:25:09 +01:00 committed by Matt Sturgeon
parent b502802572
commit b65233d5f9
2 changed files with 6 additions and 9 deletions

View file

@ -83,18 +83,14 @@ When using Nixvim, it is possible to encounter errors about something not being
error: <name> cannot be found in pkgs error: <name> cannot be found in pkgs
``` ```
This usually means one of two things: This usually means one of few things:
- You are using `follows` on `inputs.nixvim` causing Nixvim to have an unexpected version of Nixpkgs.
- The nixpkgs version is not in line with Nixvim (for example nixpkgs nixos-25.11 is used with Nixvim master) - The nixpkgs version is not in line with Nixvim (for example nixpkgs nixos-25.11 is used with Nixvim master)
- The nixpkgs unstable version used with Nixvim is not recent enough. - The nixpkgs unstable version used with Nixvim is not recent enough.
When building Nixvim using flakes and our ["standalone mode"][standalone], we usually recommend _not_ declaring a "follows" for `inputs.nixvim`. When building Nixvim using flakes, we usually recommend _not_ declaring a `follows` for `inputs.nixvim`.
This is so that Nixvim is built against the same nixpkgs revision we're using in our test suite. This is so that Nixvim is built against the same nixpkgs revision we're using in our test suite.
If you are building Nixvim using the NixOS, Home Manager, or nix-darwin modules then we advise that you keep your nixpkgs lock as close as possible to ours.
> [!TIP]
> Once [#1784](https://github.com/nix-community/nixvim/issues/1784) is implemented, there will be alternative ways to achieve this using the module system.
[standalone]: ../platforms/standalone.md [standalone]: ../platforms/standalone.md
## How do I create multiple aliases for a single keymap ## How do I create multiple aliases for a single keymap

View file

@ -35,13 +35,15 @@ When using flakes you can simply add `nixvim` to the inputs:
inputs.nixvim = { inputs.nixvim = {
url = "github:nix-community/nixvim"; url = "github:nix-community/nixvim";
# If using a stable channel you can use `url = "github:nix-community/nixvim/nixos-<version>"` # If using a stable channel you can use `url = "github:nix-community/nixvim/nixos-<version>"`
inputs.nixpkgs.follows = "nixpkgs";
}; };
# outputs... # outputs...
} }
``` ```
We recommend against using `inputs.nixpkgs.follows = "nixpkgs";` on the `nixvim` input as we test Nixvim against our Nixpkgs revision.
When you use `follows` you opt out of guarantees provided by these tests.
If you choose to use it anyway, removing `follows` should be one of the first debugging steps when encountering issues.
## Usage ## Usage
@ -51,7 +53,6 @@ When used standalone, a custom Nixvim derivation is produced that can be used li
When used as a module, Nixvim can be enabled though `programs.nixvim.enable`. When used as a module, Nixvim can be enabled though `programs.nixvim.enable`.
### Usage as a module (NixOS, Home Manager, nix-darwin) ### Usage as a module (NixOS, Home Manager, nix-darwin)
When using Nixvim as a module you must import the Nixvim module into your module system. When using Nixvim as a module you must import the Nixvim module into your module system.