Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.pull_request.title, '[skip ci]')"
steps:
- uses: actions/labeler@v5
- uses: actions/labeler@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labels.yml
Expand Down
4 changes: 2 additions & 2 deletions docs/manual/configuring/autocmds.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ with the following options:
| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` |
| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` |
| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` |
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.nvim.types.luaInline` or `lib.options.literalExpression "mkLuaInline '''...'''"`. **Cannot be used with `command`.** | `lib.nvim.types.luaInline "function() print('File saved!') end"` |
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.generators.mkLuaInline`. **Cannot be used with `command`.** | `lib.generators.mkLuaInline "function() print('File saved!') end"` |
| `command` | `nullOr str` | `null` | A Vimscript command to execute when the event triggers. **Cannot be used with `callback`.** | `"echo 'File saved!'"` |
| `group` | `nullOr str` | `null` | The name of an `augroup` (defined in `vim.augroups`) to associate this autocommand with. | `"MyCustomAuGroup"` |
| `desc` | `nullOr str` | `null` | A description for the autocommand (useful for introspection). | `"Format buffer on save"` |
Expand Down Expand Up @@ -71,7 +71,7 @@ Vimscript) for the same autocommand. Choose one.
pattern = [ "*.lua" ];
group = "UserSetup";
desc = "Notify after saving Lua file";
callback = lib.nvim.types.luaInline ''
callback = lib.generators.mkLuaInline ''
function()
vim.notify("Lua file saved!", vim.log.levels.INFO)
end
Expand Down
11 changes: 10 additions & 1 deletion docs/release-notes/rl-0.8.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
- Add [hunk.nvim], Neovim plugin & tool for splitting diffs in Neovim. Available
as `vim.git.hunk-nvim`

- Move `crates.nvim` into `languages.rust.extensions and support` `setupOpts`
for the plugin.

[amadaluzia](https://github.com/amadaluzia):

[haskell-tools.nvim]: https://github.com/MrcJkb/haskell-tools.nvim
Expand Down Expand Up @@ -480,7 +483,6 @@

[soliprem](https://github.com/soliprem):


- fix broken `neorg` grammars
- remove obsolete warning in the `otter` module

Expand Down Expand Up @@ -516,3 +518,10 @@
[htmlHINT].
- Add QMK support under `vim.utility.qmk-nvim` via [qmk-nvim].
- Add QML support under `vim.languages.qml` using [qmlls] and [qmlformat]

[Jules](https://github.com/jules-sommer):

[nvim-highlight-colors]: https://github.com/brenoprata10/nvim-highlight-colors

- Add [nvim-highlight-colors] plugin in `vim.ui.nvim-highlight-colors` with
`enable` and `setupOpts`
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake/pkgs/by-name/avante-nvim/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
pname = "avante-nvim-lib";
inherit version src;

cargoHash = "sha256-8mBpzndz34RrmhJYezd4hLrJyhVL4S4IHK3plaue1k8=";
cargoHash = "sha256-pTWCT2s820mjnfTscFnoSKC37RE7DAPKxP71QuM+JXQ=";

nativeBuildInputs = [
pkg-config
Expand Down
8 changes: 8 additions & 0 deletions modules/extra/deprecations.nix
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ in {

(mkRenamedLspServer "zig")
(mkRemovedLspPackage "zig")

# 2025-08-21
(mkRenamedOptionModule ["vim" "languages" "rust" "crates" "enable"] ["vim" "languages" "rust" "extensions" "crates-nvim" "enable"])
(mkRemovedOptionModule ["vim" "languages" "rust" "crates" "codeActions"] ''
'vim.languages.rust.crates' option has been moved to 'vim.languages.rust.extensions.crates-nvim' in full and the
codeActions option has been removed. To set up code actions again, you may use the the new 'setupOpts' option
located under 'vim.languages.rust.extensions.crates-nvim'. Refer to crates.nvim documentation for setup steps.
'')
]

# Migrated via batchRenameOptions. Further batch renames must be below this line.
Expand Down
2 changes: 1 addition & 1 deletion modules/neovim/init/autocmds.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
type = nullOr luaInline;
default = null;
example = literalExpression ''
mkLuaInline '''
lib.generators.mkLuaInline '''
function()
print("Saving a Lua file...")
end
Expand Down
76 changes: 46 additions & 30 deletions modules/plugins/languages/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@
lib,
...
}: let
inherit (builtins) attrNames;
inherit (lib.meta) getExe;
inherit (lib.modules) mkIf mkMerge;
inherit (lib.options) mkOption mkEnableOption literalMD;
inherit (lib.strings) optionalString;
inherit (lib.trivial) boolToString;
inherit (lib.lists) isList;
inherit (lib.attrsets) attrNames;
inherit (lib.types) bool package str listOf either enum;
inherit (lib.nvim.types) mkGrammarOption;
inherit (lib.nvim.lua) expToLua;
inherit (lib.nvim.types) mkGrammarOption mkPluginSetupOption;
inherit (lib.nvim.lua) expToLua toLuaObject;
inherit (lib.nvim.dag) entryAfter entryAnywhere;

cfg = config.vim.languages.rust;
Expand All @@ -33,15 +32,6 @@ in {
package = mkGrammarOption pkgs "rust";
};

crates = {
enable = mkEnableOption "crates-nvim, tools for managing dependencies";
codeActions = mkOption {
description = "Enable code actions through null-ls";
type = bool;
default = true;
};
};

lsp = {
enable = mkEnableOption "Rust LSP support (rust-analyzer with extra tools)" // {default = config.vim.lsp.enable;};
package = mkOption {
Expand Down Expand Up @@ -103,25 +93,32 @@ in {
default = pkgs.lldb;
};
};
};

config = mkIf cfg.enable (mkMerge [
(mkIf cfg.crates.enable {
vim = {
startPlugins = ["crates-nvim"];
lsp.null-ls.enable = mkIf cfg.crates.codeActions true;
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
pluginRC.rust-crates = entryAnywhere ''
require('crates').setup {
null_ls = {
enabled = ${boolToString cfg.crates.codeActions},
name = "crates.nvim",
}
}
'';
extensions = {
crates-nvim = {
enable = mkEnableOption "crates.io dependency management [crates-nvim]";

setupOpts = mkPluginSetupOption "crates-nvim" {
completion.enable = mkOption {
type = bool;
default = config.vim.autocomplete.nvim-cmp.enable;
defaultText = "{option}`config.vim.autocomplete.nvim-cmp.enable`";
description = ''
Whether to add crates.nvim as a source for completion plugins. The following
plugins are supported by crates.nvim:

* nvim-cmp
* coq.nvim

However nvf only supports auto-setup for nvim-cmp.
'';
};
};
};
})
};
};

config = mkIf cfg.enable (mkMerge [
(mkIf cfg.treesitter.enable {
vim.treesitter.enable = true;
vim.treesitter.grammars = [cfg.treesitter.package];
Expand All @@ -140,7 +137,6 @@ in {
(mkIf (cfg.lsp.enable || cfg.dap.enable) {
vim = {
startPlugins = ["rustaceanvim"];

pluginRC.rustaceanvim = entryAfter ["lsp-setup"] ''
vim.g.rustaceanvim = {
${optionalString cfg.lsp.enable ''
Expand Down Expand Up @@ -199,5 +195,25 @@ in {
'';
};
})

(mkIf cfg.extensions.crates-nvim.enable {
vim = let
withCompletion = cfg.extensions.crates-nvim.withCmpSource;
in
mkMerge [
{
startPlugins = ["crates-nvim"];
pluginRC.rust-crates = entryAnywhere ''
require("crates").setup(${toLuaObject cfg.extensions.crates-nvim.setupOpts})
'';
}

# FIXME: this will no longer be necessary when a new crates.nvim release is made.
# If updating crates.nvim, remember to remove this section.
(mkIf withCompletion {
autocomplete.nvim-cmp.sources = {crates = "[Crates]";};
})
];
})
]);
}
2 changes: 1 addition & 1 deletion modules/plugins/tabline/nvim-bufferline/config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"nvim-bufferline-lua"
"bufferline-nvim"
"bufdelete-nvim"
];

Expand Down
24 changes: 18 additions & 6 deletions modules/plugins/tabline/nvim-bufferline/nvim-bufferline.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
lib,
...
}: let
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.options) mkOption mkEnableOption literalExpression literalMD;
inherit (lib.types) enum bool either nullOr str int listOf attrs;
inherit (lib.generators) mkLuaInline;
inherit (lib.nvim.binds) mkMappingOption;
Expand All @@ -24,17 +24,28 @@ in {
movePrevious = mkMappingOption "Move previous buffer" "<leader>bmp";
};

setupOpts = mkPluginSetupOption "Bufferline-nvim" {
setupOpts = mkPluginSetupOption "bufferline-nvim" {
highlights = mkOption {
type = either attrs luaInline;
default =
if config.vim.theme.enable && config.vim.theme.name == "catppuccin"
then
mkLuaInline
''
require("catppuccin.groups.integrations.bufferline").get()
mkLuaInline ''
(function()
local integration = require("catppuccin.groups.integrations.bufferline")
return (integration.get_theme or integration.get)()
end)()
''
else {};
defaultText = literalMD ''
```lua
(function()
local integration = require("catppuccin.groups.integrations.bufferline")
return (integration.get_theme or integration.get)()
end)()
```
if the active theme is Catppuccin, `{}` otherwise.
'';
description = ''
Overrides the highlight groups of bufferline.

Expand All @@ -59,10 +70,11 @@ in {
themable = mkOption {
type = bool;
default = true;
example = false;
description = ''
Whether or not to allow highlight groups to be overridden.

While false, bufferline.nvim sets highlights as default.
While `false`, bufferline.nvim sets highlights as default.
'';
};

Expand Down
3 changes: 3 additions & 0 deletions modules/plugins/theme/supported-themes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ in {
require('catppuccin').setup {
flavour = "${style}",
transparent_background = ${boolToString transparent},
float = {
transparent = ${boolToString transparent},
},
term_colors = true,
integrations = {
nvimtree = {
Expand Down
1 change: 1 addition & 0 deletions modules/plugins/ui/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
./borders
./breadcrumbs
./colorful-menu-nvim
./nvim-highlight-colors
./colorizer
./fastaction
./illuminate
Expand Down
28 changes: 28 additions & 0 deletions modules/plugins/ui/nvim-highlight-colors/config.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;

cfg = config.vim.ui.nvim-highlight-colors;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
"nvim-highlight-colors"
];

# enable display of 24-bit RGB colors in neovim
# via the terminal. This is required for nvim-highlight-colors
# to display arbitrary RGB highlights.
options.termguicolors = true;

pluginRC.nvim-highlight-colors = entryAnywhere ''
require('nvim-highlight-colors').setup(${toLuaObject cfg.setupOpts})
'';
};
};
}
6 changes: 6 additions & 0 deletions modules/plugins/ui/nvim-highlight-colors/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
imports = [
./nvim-highlight-colors.nix
./config.nix
];
}
Loading
Loading