Compare commits

...

10 commits

Author SHA1 Message Date
nixvim-ci[bot]
844cb1c1b7 flake: Update
flake.lock updates:
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/2cccadc7357c0ba201788ae99c4dfa90728ef5e0?narHash=sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q%3D' (2025-11-21)
  → 'github:hercules-ci/flake-parts/5635c32d666a59ec9a55cab87e898889869f7b71?narHash=sha256-MhA7wmo/7uogLxiewwRRmIax70g6q1U/YemqTGoFHlM%3D' (2025-12-11)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c97c47f2bac4fa59e2cbdeba289686ae615f8ed4?narHash=sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA%3D' (2025-12-04)
  → 'github:NixOS/nixpkgs/09eb77e94fa25202af8f3e81ddc7353d9970ac1b?narHash=sha256-mSD5Ob7a%2BT2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo%3D' (2025-12-09)

flake/dev/flake.lock updates:
• Updated input 'dev-nixpkgs':
    'github:NixOS/nixpkgs/c97c47f2bac4fa59e2cbdeba289686ae615f8ed4?narHash=sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA%3D' (2025-12-04)
  → 'github:NixOS/nixpkgs/09eb77e94fa25202af8f3e81ddc7353d9970ac1b?narHash=sha256-mSD5Ob7a%2BT2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo%3D' (2025-12-09)
• Updated input 'flake-compat':
    'github:NixOS/flake-compat/4dd386262c30922367e6b549c81e9cbdf8f3132f?narHash=sha256-JbjxGEA9gVRZ47LylRFe7TLVjI2KaoW0cwflbQ2apBs%3D' (2025-12-04)
  → 'github:NixOS/flake-compat/63d095ca43128741b16fc354b1e918757e6b66e5?narHash=sha256-QN1r/zNqvXHwWqlRAnRtFf4CQwIOJx58PtdExIzAw94%3D' (2025-12-08)
• Updated input 'git-hooks':
    'github:cachix/git-hooks.nix/548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c?narHash=sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ%3D' (2025-12-06)
  → 'github:cachix/git-hooks.nix/09e45f2598e1a8499c3594fe11ec2943f34fe509?narHash=sha256-dixPWKiHzh80PtD0aLuxYNQ0xP%2B843dfXG/yM3OzaYQ%3D' (2025-12-11)
• Updated input 'home-manager':
    'github:nix-community/home-manager/f63d0fe9d81d36e5fc95497217a72e02b8b7bcab?narHash=sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM%3D' (2025-12-04)
  → 'github:nix-community/home-manager/90b62096f099b73043a747348c11dbfcfbdea949?narHash=sha256-RM2xs%2B1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango%3D' (2025-12-13)
• Updated input 'nix-darwin':
    'github:lnl7/nix-darwin/e95de00a471d07435e0527ff4db092c84998698e?narHash=sha256-HN84sByg9FhJnojkGGDSrcjcbeioFWoNXfuyYfJ1kBE%3D' (2025-11-26)
  → 'github:lnl7/nix-darwin/688427b1aab9afb478ca07989dc754fa543e03d5?narHash=sha256-0YSU35gfRFJzx/lTGgOt6ubP8K6LeW0vaywzNNqxkl4%3D' (2025-12-07)
2025-12-13 13:23:25 +00:00
Matt Sturgeon
a9d0e063bc modules/lsp: fix mkServerOption homepage tryEval evaluation
`lib.pipe` strictly evaluates intermediate steps using `foldl'`. As a
result, piping `(opts: opts.package.default or null)` →
`(package: (tryEval package).value)` is ineffective because
`opts.package.default` is evaluated before `tryEval` can catch exceptions.

Instead, inline `opts.package.default` directly into the `tryEval`
expression, ensuring missing package errors caught correctly.

Resolves errors when building NixOS or nix-darwin docs that include
Nixvim options.

Adds a regression test.

(cherry picked from commit 463fb0ad5d)
2025-12-08 16:40:31 +00:00
nixvim-ci[bot]
cb9357fe10 flake: Update
flake.lock updates:
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ba9b83e5fb4b552a423d24dabe5ccb47a9c89901?narHash=sha256-1LNGcU%2BaTbATD3BPCf7U1KsP1CjCH%2BZWqM6JH0sZ6Q0%3D' (2025-11-28)
  → 'github:NixOS/nixpkgs/c97c47f2bac4fa59e2cbdeba289686ae615f8ed4?narHash=sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA%3D' (2025-12-04)

flake/dev/flake.lock updates:
• Updated input 'dev-nixpkgs':
    'github:NixOS/nixpkgs/ba9b83e5fb4b552a423d24dabe5ccb47a9c89901?narHash=sha256-1LNGcU%2BaTbATD3BPCf7U1KsP1CjCH%2BZWqM6JH0sZ6Q0%3D' (2025-11-28)
  → 'github:NixOS/nixpkgs/c97c47f2bac4fa59e2cbdeba289686ae615f8ed4?narHash=sha256-OtzF5wBvO0jgW1WW1rQU9cMGx7zuvkF7CAVJ1ypzkxA%3D' (2025-12-04)
• Updated input 'flake-compat':
    'github:NixOS/flake-compat/01ad7ce89c455171e4f864799b21d0785ba94a3a?narHash=sha256-bHDJDoMHMMctf90Ug0po2LNanPgdB8aRl0psH7%2BTWzc%3D' (2025-10-27)
  → 'github:NixOS/flake-compat/4dd386262c30922367e6b549c81e9cbdf8f3132f?narHash=sha256-JbjxGEA9gVRZ47LylRFe7TLVjI2KaoW0cwflbQ2apBs%3D' (2025-12-04)
• Updated input 'git-hooks':
    'github:cachix/git-hooks.nix/50b9238891e388c9fdc6a5c49e49c42533a1b5ce?narHash=sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh%2BM4Qc%3D' (2025-11-24)
  → 'github:cachix/git-hooks.nix/548fc44fca28a5e81c5d6b846e555e6b9c2a5a3c?narHash=sha256-rhSqPNxDVow7OQKi4qS5H8Au0P4S3AYbawBSmJNUtBQ%3D' (2025-12-06)
• Updated input 'home-manager':
    'github:nix-community/home-manager/3fdd076e08049a9c7a83149b270440d9787d2df5?narHash=sha256-BgtcUkBfItu9/yU14IgUaj4rYOanTOUZjUfBP20/ZB4%3D' (2025-11-30)
  → 'github:nix-community/home-manager/f63d0fe9d81d36e5fc95497217a72e02b8b7bcab?narHash=sha256-0GsEtXV9OquDQ1VclQfP16cU5VZh7NEVIOjSH4UaJuM%3D' (2025-12-04)
2025-12-06 13:18:42 +00:00
Matt Sturgeon
64d9e2616f modules/version: init with nixpkgsReleaseCheck
Inspired by `home.version` and `home.enableNixpkgsReleaseCheck` in Home
Manager. Print a warning when `lib` or `pkgs` are from a different
release to Nixvim.

(cherry picked from commit b0f3a36596)
2025-12-03 09:49:56 +00:00
saygo-png
48e4df646d plugins/friendly-snippets: fix warning
Signed-off-by: saygo-png <saygo.mail@proton.me>
(cherry picked from commit ee6ccaae42)
2025-12-02 08:28:29 +00:00
Gaetan Lepage
6bdabc1359 flake/dev/flake.nix: use stable branch for home-manager and nix-darwin 2025-12-01 18:38:02 +00:00
Gaetan Lepage
28058b3e09 treewide: 25.05 -> 25.11
(cherry picked from commit af1ce0d14c)
2025-12-01 18:01:03 +00:00
Heitor Augusto
e36a7fd479 modules/files: ensure derivation is recognized as vim plugin
(cherry picked from commit 027c96a161)
2025-12-01 17:43:36 +00:00
Matt Sturgeon
967ba0bbe1 flake: explicitly configure commit-lock-file-summary
Sets `nixConfig.commit-lock-file-summary` to "flake: Update", matching
the default used by `ci/update`. This ensures consistency when running
`nix flake update --commit-lock-file` or `nix flake lock --commit-lock-file`
manually.

Note: manual updates are discouraged. The `nix-build ci -A update`
script should be used to update flakes. This ensures both root and dev
lockfiles — as well as `version-info.toml` — are kept in sync.

(cherry picked from commit aab92fcc99)
2025-11-30 21:42:52 +00:00
Matt Sturgeon
79b887f068 ci/update: refactor to produce a single lockfile commit
Refactors the flake update script to consolidate root and dev lockfile
updates into a single commit. Changes include:

- Captures and normalizes `nix flake update` output.
- Removes reliance on `--commit-lock-file` and `--amend`.
- Eliminates the need to track or compare HEAD commits manually.
- Only commit when flake.lock, flake/dev/flake.lock, or
  version-info.toml have changes.

(cherry picked from commit d269170e38)
2025-11-30 21:42:52 +00:00
18 changed files with 291 additions and 90 deletions

View file

@ -13,9 +13,9 @@ Deprecations should include a comment in the format of:
where:
- `n` is the current release; 25.05 at the time of writing
- `n+1` is the next release; 25.11 at the time of writing
- `n+2` is the release following `n+1`; 26.05 at the time of writing
- `n` is the current release; 25.11 at the time of writing
- `n+1` is the next release; 26.05 at the time of writing
- `n+2` is the release following `n+1`; 26.11 at the time of writing
If a warning is created on release `n`, then:

View file

@ -91,7 +91,7 @@ If you have any question, please use the [discussions page](https://github.com/n
> Nixvim needs to be installed with a compatible nixpkgs version.
> This means that the `main` branch of Nixvim requires to be installed with `nixpkgs-unstable`.
>
> If you want to use Nixvim with nixpkgs 25.05 you should use the `nixos-25.05` branch.
> If you want to use Nixvim with nixpkgs 25.11 you should use the `nixos-25.11` branch.
For more detail, see the [Installation](https://nix-community.github.io/nixvim) section of our documentation.
@ -108,7 +108,7 @@ let
nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of Nixvim.
# ref = "nixos-25.05";
# ref = "nixos-25.11";
});
in
{
@ -151,7 +151,7 @@ flakes, just add the `nixvim` input:
inputs.nixvim = {
url = "github:nix-community/nixvim";
# If you are not running an unstable channel of nixpkgs, select the corresponding branch of Nixvim.
# url = "github:nix-community/nixvim/nixos-25.05";
# url = "github:nix-community/nixvim/nixos-25.11";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -286,7 +286,7 @@ in pkgs.mkShell {
Documentation is available on this project's GitHub Pages page:
[https://nix-community.github.io/nixvim](https://nix-community.github.io/nixvim)
The stable documentation is also available at [https://nix-community.github.io/nixvim/25.05](https://nix-community.github.io/nixvim/25.05).
The stable documentation is also available at [https://nix-community.github.io/nixvim/25.11](https://nix-community.github.io/nixvim/25.11).
If the option `enableMan` is set to `true` (by default it is), man pages will also
be installed containing the same information, they can be viewed with `man nixvim`.

View file

@ -26,86 +26,114 @@ writeShellApplication {
shift
done
update_args=( )
if [ -n "$commit" ]; then
update_args+=( "--commit-lock-file" )
fi
# Ensure we run at the root of the flake
cd "$(git rev-parse --show-toplevel)"
currentCommit() {
git show --no-patch --format=%h
}
workdir=$(mktemp -d -t update-XXXXXX)
trap 'rm -rf "$workdir"' EXIT
root_update="$workdir/root_update"
dev_update="$workdir/dev_update"
root_msg="$workdir/root_msg"
dev_msg="$workdir/dev_msg"
commit_msg="$workdir/commit_msg"
hasChanges() {
old="$1"
new="$2"
if [ -n "$commit" ]; then
[ "$old" != "$new" ]
elif git diff --quiet; then
return 1
else
return 0
fi
cleanUpdateOutput() {
awk --assign prefix="$PWD/" '
# Find the start of the update info block
/^warning: updating lock file "/ {
if (match($0, /"([^"]+)"/, m)) {
# Print the first line as `{path} updates:`
path = m[1]
sub("^" prefix, "", path)
print path " updates:"
# Mark that we have entered the update info block
printing=1
}
next
}
# Print while in the update info block
printing {
if ($0 == "") exit
print
}
' "$1"
}
writeGitHubOutput() {
if [ -n "$use_github_output" ] && [ -n "$commit" ]; then
if [ -n "$use_github_output" ]; then
{
echo "$1<<EOF"
git show --no-patch --format=%b
cat "$2"
echo "EOF"
} >> "$GITHUB_OUTPUT"
fi
}
versionInfo() {
extra_args=( )
if [ "$1" = "--amend" ]; then
extra_args+=(
"--amend"
"--no-edit"
)
fi
echo "Updating version-info"
"$(nix-build ./ci -A version-info --no-out-link)"/bin/version-info
if [ -n "$commit" ]; then
git add version-info.toml
git commit "''${extra_args[@]}"
fi
}
# Initialise version-info.toml
if [ ! -f version-info.toml ]; then
echo "Creating version-info file"
versionInfo -m "version-info: init"
versionInfo
if [ -n "$commit" ]; then
git add version-info.toml
git commit -m "version-info: init"
fi
fi
# Commit message summary
{
# Avoid using impure global config from `nix config show commit-lock-file-summary`
nix-instantiate --raw --eval flake.nix --attr nixConfig.commit-lock-file-summary 2>/dev/null \
|| echo -n "flake: Update"
printf '\n'
} >"$commit_msg"
# Update the root lockfile
old=$(currentCommit)
echo "Updating root lockfile"
nix flake update "''${update_args[@]}"
new=$(currentCommit)
if hasChanges "$old" "$new"; then
echo "Updating version-info"
versionInfo --amend
writeGitHubOutput root_lock_body
nix flake update 2> >(tee "$root_update" >&2)
cleanUpdateOutput "$root_update" > "$root_msg"
if [ -s "$root_msg" ]; then
{
printf '\n'
cat "$root_msg"
} >>"$commit_msg"
versionInfo
writeGitHubOutput root_lock_body "$root_msg"
fi
# Update the dev lockfile
root_nixpkgs=$(nix eval --raw --file . 'inputs.nixpkgs.rev')
old=$(currentCommit)
echo "Updating dev lockfile"
nix flake update "''${update_args[@]}" \
nix flake update \
--override-input 'dev-nixpkgs' "github:NixOS/nixpkgs/$root_nixpkgs" \
--flake './flake/dev'
new=$(currentCommit)
if hasChanges "$old" "$new"; then
echo "Updating version-info"
versionInfo --amend
writeGitHubOutput dev_lock_body
--flake './flake/dev' \
2> >(tee "$dev_update" >&2)
cleanUpdateOutput "$dev_update" > "$dev_msg"
if [ -s "$dev_msg" ]; then
{
printf '\n'
cat "$dev_msg"
} >>"$commit_msg"
versionInfo
writeGitHubOutput dev_lock_body "$dev_msg"
fi
# Only commit if at least one file has changes
if git diff --quiet flake.lock flake/dev/flake.lock version-info.toml; then
echo "Nothing to commit"
elif [ -n "$commit" ]; then
echo "Committing"
git add flake.lock flake/dev/flake.lock version-info.toml
git commit --file "$commit_msg"
else
echo "Would commit as (skipping):"
cat "$commit_msg"
fi
'';
}

View file

@ -84,7 +84,7 @@ When using Nixvim, it is possible to encounter errors about something not being
```
This usually means one of two things:
- The nixpkgs version is not in line with NixVim (for example nixpkgs nixos-25.05 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.
When building nixvim using flakes and our ["standalone mode"][standalone], we usually recommend _not_ declaring a "follows" for `inputs.nixvim`.

View file

@ -5,7 +5,7 @@ You must use a `nixpkgs` version compatible with the nixvim version you choose.
The `main` branch requires to use a _very recent_ version of nixpkgs unstable.
In order to guarantee the compatibility between nixvim & nixpkgs it is recommended to always update both at the same time.
When using a `stable` version you must use the corresponding nixvim branch, for example `nixos-25.05` when using NixOS 25.05.
When using a `stable` version you must use the corresponding nixvim branch, for example `nixos-25.11` when using NixOS 25.11.
Failure to use the correct branch, or an old revision of nixpkgs will likely result in errors of the form `vimPlugins.<name> attribute not found`.

12
flake.lock generated
View file

@ -7,11 +7,11 @@
]
},
"locked": {
"lastModified": 1763759067,
"narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"lastModified": 1765495779,
"narHash": "sha256-MhA7wmo/7uogLxiewwRRmIax70g6q1U/YemqTGoFHlM=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"rev": "5635c32d666a59ec9a55cab87e898889869f7b71",
"type": "github"
},
"original": {
@ -66,11 +66,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1764338033,
"narHash": "sha256-1LNGcU+aTbATD3BPCf7U1KsP1CjCH+ZWqM6JH0sZ6Q0=",
"lastModified": 1765311797,
"narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ba9b83e5fb4b552a423d24dabe5ccb47a9c89901",
"rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b",
"type": "github"
},
"original": {

View file

@ -18,6 +18,7 @@
};
nixConfig = {
commit-lock-file-summary = "flake: Update";
extra-substituters = [ "https://nix-community.cachix.org" ];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="

32
flake/dev/flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"dev-nixpkgs": {
"locked": {
"lastModified": 1764338033,
"narHash": "sha256-1LNGcU+aTbATD3BPCf7U1KsP1CjCH+ZWqM6JH0sZ6Q0=",
"lastModified": 1765311797,
"narHash": "sha256-mSD5Ob7a+T2RNjvPvOA1dkJHGVrNVl8ZOrAwBjKBDQo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ba9b83e5fb4b552a423d24dabe5ccb47a9c89901",
"rev": "09eb77e94fa25202af8f3e81ddc7353d9970ac1b",
"type": "github"
},
"original": {
@ -38,11 +38,11 @@
},
"flake-compat": {
"locked": {
"lastModified": 1761588617,
"narHash": "sha256-bHDJDoMHMMctf90Ug0po2LNanPgdB8aRl0psH7+TWzc=",
"lastModified": 1765186200,
"narHash": "sha256-QN1r/zNqvXHwWqlRAnRtFf4CQwIOJx58PtdExIzAw94=",
"owner": "NixOS",
"repo": "flake-compat",
"rev": "01ad7ce89c455171e4f864799b21d0785ba94a3a",
"rev": "63d095ca43128741b16fc354b1e918757e6b66e5",
"type": "github"
},
"original": {
@ -63,11 +63,11 @@
]
},
"locked": {
"lastModified": 1763988335,
"narHash": "sha256-QlcnByMc8KBjpU37rbq5iP7Cp97HvjRP0ucfdh+M4Qc=",
"lastModified": 1765464257,
"narHash": "sha256-dixPWKiHzh80PtD0aLuxYNQ0xP+843dfXG/yM3OzaYQ=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "50b9238891e388c9fdc6a5c49e49c42533a1b5ce",
"rev": "09e45f2598e1a8499c3594fe11ec2943f34fe509",
"type": "github"
},
"original": {
@ -104,15 +104,16 @@
]
},
"locked": {
"lastModified": 1764361670,
"narHash": "sha256-jgWzgpIaHbL3USIq0gihZeuy1lLf2YSfwvWEwnfAJUw=",
"lastModified": 1765605144,
"narHash": "sha256-RM2xs+1HdHxesjOelxoA3eSvXShC8pmBvtyTke4Ango=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "780be8ef503a28939cf9dc7996b48ffb1a3e04c6",
"rev": "90b62096f099b73043a747348c11dbfcfbdea949",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.11",
"repo": "home-manager",
"type": "github"
}
@ -124,15 +125,16 @@
]
},
"locked": {
"lastModified": 1764161084,
"narHash": "sha256-HN84sByg9FhJnojkGGDSrcjcbeioFWoNXfuyYfJ1kBE=",
"lastModified": 1765066094,
"narHash": "sha256-0YSU35gfRFJzx/lTGgOt6ubP8K6LeW0vaywzNNqxkl4=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "e95de00a471d07435e0527ff4db092c84998698e",
"rev": "688427b1aab9afb478ca07989dc754fa543e03d5",
"type": "github"
},
"original": {
"owner": "lnl7",
"ref": "nix-darwin-25.11",
"repo": "nix-darwin",
"type": "github"
}

View file

@ -25,12 +25,12 @@
};
home-manager = {
url = "github:nix-community/home-manager";
url = "github:nix-community/home-manager/release-25.11";
inputs.nixpkgs.follows = "dev-nixpkgs";
};
nix-darwin = {
url = "github:lnl7/nix-darwin";
url = "github:lnl7/nix-darwin/nix-darwin-25.11";
inputs.nixpkgs.follows = "dev-nixpkgs";
};

View file

@ -40,10 +40,10 @@ let
# Get suboptions of `lsp.servers.<name>`
(opts: opts.${name}.type.getSubOptions opts.${name}.loc)
# Get the default package
(opts: opts.package.default or null)
# The default throws if mkPackageOption can't find the package
# E.g. mismatched nixpkgs revision
(package: (builtins.tryEval package).value)
#
# Use tryEval to catch throws when mkPackageOption can't find the package,
# e.g., due to a mismatched nixpkgs revision
(opts: (builtins.tryEval (opts.package.default or null)).value)
# Get package's homepage
(package: package.meta.homepage or null)
];

View file

@ -4,5 +4,6 @@
./context.nix
./meta.nix
./nixvim-info.nix
./version.nix
];
}

74
modules/misc/version.nix Normal file
View file

@ -0,0 +1,74 @@
{
lib,
pkgs,
config,
options,
...
}:
let
versionInfo = lib.importTOML ../../version-info.toml;
in
{
options.version = {
release = lib.mkOption {
type = lib.types.str;
default = versionInfo.release;
description = "The Nixvim release.";
internal = true;
readOnly = true;
};
isUnstable = lib.mkOption {
type = lib.types.bool;
default = versionInfo.unstable;
description = "Whether Nixvim is from an unstable branch.";
internal = true;
readOnly = true;
};
enableNixpkgsReleaseCheck = lib.mkOption {
type = lib.types.bool;
default = true;
example = false;
description = ''
Whether to check for release version mismatch between Nixvim and Nixpkgs.
Using mismatched versions is likely to cause errors and unexpected behavior.
It is highly recommended to use corresponding Nixvim and Nixpkgs releases.
When this option is enabled and a mismatch is detected,
a warning will be printed when the Nixvim configuration is evaluated.
'';
};
};
config = {
warnings =
let
nixvimRelease = config.version.release;
libRelease = lib.trivial.release;
pkgsRelease = pkgs.lib.trivial.release;
releaseMismatch = nixvimRelease != libRelease || nixvimRelease != pkgsRelease;
in
lib.optional (config.version.enableNixpkgsReleaseCheck && releaseMismatch) ''
You are using${
if libRelease == pkgsRelease then
" Nixvim version ${nixvimRelease} and Nixpkgs version ${libRelease}."
else
''
:
- Nixvim version: ${nixvimRelease}
- Nixpkgs version used to evaluate Nixvim: ${libRelease}
- Nixpkgs version used for packages (`pkgs`): ${pkgsRelease}''
}
Using mismatched versions is likely to cause errors and unexpected behavior.
It is highly recommended to use corresponding Nixvim and Nixpkgs releases.
If you insist, you can disable this warning using:
${options.version.enableNixpkgsReleaseCheck} = false;
'';
};
}

View file

@ -77,7 +77,7 @@ in
# A directory with all the files in it
# Implementation based on NixOS's /etc module
build.extraFiles = pkgs.runCommandLocal "nvim-config" { } ''
build.extraFiles = pkgs.runCommandLocal "nvim-config" { passthru.vimPlugin = true; } ''
set -euo pipefail
makeEntry() {

View file

@ -27,7 +27,9 @@ lib.nixvim.plugins.mkVimPlugin {
{
when =
config.performance.combinePlugins.enable
&& !(builtins.elem "friendly-snippets" config.performance.combinePlugins.standalonePlugins)
&& !(builtins.elem "friendly-snippets" (
map lib.getName config.performance.combinePlugins.standalonePlugins
))
&& (enabledConsumers != [ ]);
message = ''
When using ${options.performance.combinePlugins.enable}, ${options.plugins.friendly-snippets.enable} and ${enabledConsumersPretty}:

View file

@ -24,6 +24,7 @@ let
runNvim = false;
runCommand = runCommandLocal;
};
version.enableNixpkgsReleaseCheck = false;
}
../modules/misc
../modules/top-level/test.nix

View file

@ -1,3 +1,4 @@
{ pkgs }:
{
example = {
lsp.servers = {
@ -254,4 +255,51 @@
}
];
};
# Regression test for mkServerOption:
# Ensures tryEval catches missing packages when evaluating the description.
# See https://github.com/nix-community/nixvim/issues/4033
missing-package =
{ lib, options, ... }:
let
# `lsp.servers.lua_ls` option
serverOpt = lib.pipe options.lsp.servers [
(opt: opt.type.getSubOptions opt.loc)
(opts: opts.lua_ls)
];
# `lsp.servers.lua_ls.package` option
packageOpt = (serverOpt.type.getSubOptions serverOpt.loc).package;
# The lua_ls package attr to remove from pkgs
packageName = lib.pipe ../../../plugins/lsp/lsp-packages.nix [
import
(lib.getAttr "packages")
(lib.getAttr "lua_ls")
lib.toList
lib.head
];
in
{
# Remove lua_ls's package
_module.args.pkgs = lib.mkOverride 0 (lib.removeAttrs pkgs [ packageName ]);
assertions = [
{
# Expect the lua_ls description to evaluate without a link
assertion = serverOpt.description == "The lua_ls language server.\n";
message = ''
Wrong description for `${serverOpt}`. Found:
${serverOpt.description}
'';
}
{
# Expect the package default to throw
assertion = !(builtins.tryEval packageOpt.default).success;
message = "Expected `${packageOpt}`'s default to throw.";
}
];
test.buildNixvim = false;
};
}

View file

@ -0,0 +1,44 @@
{ pkgs }:
{
invalid-pkgs =
{ lib, config, ... }:
let
versionInfo = lib.importTOML ../../../version-info.toml;
nixvimRelease = versionInfo.release;
pkgsRelease = "<invalid>";
in
{
# The test-suite uses `pkgs = mkForce`, so override it.
# Overlay `pkgs` with an invalid `release`:
_module.args.pkgs = lib.mkOverride 0 (
pkgs.extend (
final: prev: {
lib = prev.lib.extend (
final: prev: {
trivial = prev.trivial // {
release = pkgsRelease;
};
}
);
}
)
);
test.warnings = expect: [
(expect "count" 1)
(expect "any" "You are using:")
(expect "any" "- Nixvim version: ${nixvimRelease}")
(expect "any" "- Nixpkgs version used to evaluate Nixvim: ${nixvimRelease}")
(expect "any" "- Nixpkgs version used for packages (`pkgs`): ${pkgsRelease}")
(expect "any" "If you insist, you can disable this warning using:")
(expect "any" " version.enableNixpkgsReleaseCheck = false;")
];
assertions = [
{
assertion = config.version.release == nixvimRelease;
message = "Expected `config.version.release` to be ${nixvimRelease}, found ${config.version.release}";
}
];
};
}

View file

@ -1,18 +1,18 @@
# DO NOT MODIFY!
# This file was generated by ci/version-info/default.nix
nixpkgs_rev = "ba9b83e5fb4b552a423d24dabe5ccb47a9c89901"
nixpkgs_rev = "09eb77e94fa25202af8f3e81ddc7353d9970ac1b"
release = "25.11"
unstable = false
[versions."25.05"]
branch = "nixos-25.05"
channel = "nixos-25.05"
status = "stable"
status = "deprecated"
[versions."25.11"]
branch = "nixos-25.11"
channel = "nixos-25.11"
status = "beta"
status = "stable"
[versions."26.05"]
branch = "main"