Lua runtime error from generated lua file <Nixvim>

When building NixVim via Nix flakes, I get a Lua runtime error in the generated init.lua file. The error occurs immediately when launching nixvim.

Error detected while processing /nix/store/196saxghgkmg4dypms6nvgdgipvann40-init.lua:
E5113: Error while calling lua chunk: /nix/store/196saxghgkmg4dypms6nvgdgipvann40-init.lua:0: attempt to call a nil valuestack traceback:/nix/store/196saxghgkmg4dypms6nvgdgipvann40-init.lua: in function </nix/store/196saxghgkmg4dypms6nvgdgipvann40-init.lua:0>Press ENTER or type command to continue

I tried opening up the provided path in the editor, and it include a weird letter at line 1: eLJ  thought i must have entered a typo in extraConfigLua but it ain’t the case.633 lines of transformed texts and the first line seemed a little weird. I tried disabling plugins and stuffs, errors keep appearing i removed results (build artifacts folder too), did removed the symlink from the store too and did nix collect garbage too but it does not seem to be working , i am not very fluent at nix and have poor debugging skillswould be very helpful if you could help me out system details : nix (Nix) 2.33.1+1

nix-env (Nix) 2.33.1+1

  • system: β€œx86_64-linux”
  • host os: Linux 6.18.7, NixOS, 26.05 (Yarara), 26.05.20260126.bfc1b8a
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.33.1+1
  • channels(root): β€œβ€
  • nixpkgs: /nix/store/12azrzlywd7jmsg1q9n4dpqqgb33p2wl-source

β€œx86_64-linux”

Resolved URL: git+file:///home/archbishop/nixos-config?dir=archbishop/nixvim
Description: A nixvim configuration with custom plugins
Path: /nix/store/l0xwh0fw59im5fdaxi3q57ckix7988v1-source
Revision: 6420ec6ce40cf4dcdaa050e2d86564f4102174a0-dirty
Last modified: 2025-12-02 22:59:10
Fingerprint: d43283ead1f21156d1d5ae15dc766c5bc677bd1318e2ef4a9da3603e3bd6340e
Inputs:
β”œβ”€β”€β”€flake-utils: github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D (2024-11-13 21:27:16
)
β”‚ └───systems: github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D (2023-04-09 08:27:08)
β”œβ”€β”€β”€nixpkgs: github:NixOS/nixpkgs/62c8382960464ceb98ea593cb8321a2cf8f9e3e5?narHash=sha256-kKB3bqYJU5nzYeIROI82Ef9VtTbu4uA3YydSk/Bioa8%3D (2026-01-30 16:06:07)
└───nixvim: github:nix-community/nixvim/31c3b3687dc85e3fbbf5c44728a5ee231608f8a9?narHash=sha256-Qlb19PP0n6s%2Bv1MywVjROV5XwsCvA58XXiXHk0Govb4%3D (2026-02-02 09:38:23)
β”œβ”€β”€β”€flake-parts: github:hercules-ci/flake-parts/80daad04eddbbf5a4d883996a73f3f542fa437ac?narHash=sha256-PVvu7OqHBGWN16zSi6tEmPwwHQ4rLPU9Plvs8/1TUBY%3D (2026-01-11 12
:41:02)
β”‚ └───nixpkgs-lib follows input β€˜nixvim/nixpkgs’
β”œβ”€β”€β”€nixpkgs: github:NixOS/nixpkgs/ed142ab1b3a092c4d149245d0c4126a5d7ea00b0?narHash=sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS%2B8A%3D (2026-01-20 02:11:35)
└───systems: github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D (2023-04-09 08:27:08)
warning: Git tree β€˜/home/archbishop/nixos-config’ is dirty
git+file:///home/archbishop/nixos-config?dir=archbishop/nixvim
β”œβ”€β”€β”€checks
β”‚ β”œβ”€β”€β”€aarch64-darwin
β”‚ β”‚ └───default omitted (use β€˜β€“all-systems’ to show)
β”‚ β”œβ”€β”€β”€aarch64-linux
β”‚ β”‚ └───default omitted (use β€˜β€“all-systems’ to show)
β”‚ β”œβ”€β”€β”€x86_64-darwin
β”‚ β”‚ └───default omitted (use β€˜β€“all-systems’ to show)
β”‚ └───x86_64-linux
β”‚ └───default: derivation β€˜My-nixvim-configuration’
β”œβ”€β”€β”€devShells
β”‚ β”œβ”€β”€β”€aarch64-darwin
β”‚ β”‚ └───default omitted (use β€˜β€“all-systems’ to show)
β”‚ β”œβ”€β”€β”€aarch64-linux
β”‚ β”‚ └───default omitted (use β€˜β€“all-systems’ to show)
β”‚ β”œβ”€β”€β”€x86_64-darwin
β”‚ β”‚ └───default omitted (use β€˜β€“all-systems’ to show)
β”‚ └───x86_64-linux

the nixvim structure looks like the folllowing:

ξ©£ …/nixvim  tree
.
β”œβ”€β”€ config
β”‚ β”œβ”€β”€ clipboard.nix
β”‚ β”œβ”€β”€ colors
β”‚ β”‚ β”œβ”€β”€ aquarium.nix
β”‚ β”‚ β”œβ”€β”€ decay.nix
β”‚ β”‚ β”œβ”€β”€ everblush.nix
β”‚ β”‚ β”œβ”€β”€ everforest.nix
β”‚ β”‚ β”œβ”€β”€ gruvbox_mt_hard.nix
β”‚ β”‚ β”œβ”€β”€ gruvbox.nix
β”‚ β”‚ β”œβ”€β”€ jellybeans.nix
β”‚ β”‚ β”œβ”€β”€ kanagawa-waves.nix
β”‚ β”‚ β”œβ”€β”€ mountain.nix
β”‚ β”‚ β”œβ”€β”€ nord-chime.nix
β”‚ β”‚ β”œβ”€β”€ paradise.nix
β”‚ β”‚ β”œβ”€β”€ radium.nix
β”‚ β”‚ └── tokyonight.nix
β”‚ β”œβ”€β”€ core
β”‚ β”‚ β”œβ”€β”€ compe
β”‚ β”‚ β”‚ β”œβ”€β”€ blink.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ cmp.nix_bak
β”‚ β”‚ β”‚ β”œβ”€β”€ copilot-cmp.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ lspkind.nix
β”‚ β”‚ β”‚ └── schemastore.nix.bak
β”‚ β”‚ β”œβ”€β”€ git
β”‚ β”‚ β”‚ β”œβ”€β”€ fuzitive.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ gitlinker.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ gitsigns.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ lazygit.nix
β”‚ β”‚ β”‚ └── worktree.nix
β”‚ β”‚ β”œβ”€β”€ lint
β”‚ β”‚ β”‚ └── lint.nix
β”‚ β”‚ β”œβ”€β”€ lsp
β”‚ β”‚ β”‚ β”œβ”€β”€ conform.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ fidget.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ lsp.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ lspsaga.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ none-ls.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ rzls.nix.bak
β”‚ β”‚ β”‚ β”œβ”€β”€ specific
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ clang.nix
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ dotnet.nix
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ java.nix
β”‚ β”‚ β”‚ β”‚ └── rust.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ tiny_diagnostic.nix
β”‚ β”‚ β”‚ └── trouble.nix
β”‚ β”‚ β”œβ”€β”€ test
β”‚ β”‚ β”‚ └── test.nix.bak
β”‚ β”‚ └── treesitter
β”‚ β”‚ β”œβ”€β”€ treesitter-context.nix
β”‚ β”‚ β”œβ”€β”€ treesitter.nix
β”‚ β”‚ └── treesitter-textobjects.nix
β”‚ β”œβ”€β”€ default.nix
β”‚ β”œβ”€β”€ highlight.nix
β”‚ β”œβ”€β”€ keys.nix
β”‚ β”œβ”€β”€ plugins
β”‚ β”‚ β”œβ”€β”€ snips
β”‚ β”‚ β”‚ β”œβ”€β”€ luasnip.nix
β”‚ β”‚ β”‚ └── snippets
β”‚ β”‚ β”‚ └── csharp.lua
β”‚ β”‚ β”œβ”€β”€ statbar
β”‚ β”‚ β”‚ β”œβ”€β”€ lualine.nix
β”‚ β”‚ β”‚ └── staline.nix.bak
β”‚ β”‚ β”œβ”€β”€ tailwind.nix
β”‚ β”‚ β”œβ”€β”€ themes
β”‚ β”‚ β”‚ └── colorscheme.nix
β”‚ β”‚ β”œβ”€β”€ ui
β”‚ β”‚ β”‚ β”œβ”€β”€ btw.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ bufferline.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ noice.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ nvim-notify.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ telescope.nix
β”‚ β”‚ β”‚ └── transparent.nix
β”‚ β”‚ └── utils
β”‚ β”‚ β”œβ”€β”€ colorizer.nix
β”‚ β”‚ β”œβ”€β”€ comment.nix
β”‚ β”‚ β”œβ”€β”€ dadbod.nix
β”‚ β”‚ β”œβ”€β”€ dev_icons.nix
β”‚ β”‚ β”œβ”€β”€ flash.nix
β”‚ β”‚ β”œβ”€β”€ fzf.nix
β”‚ β”‚ β”œβ”€β”€ grapple.nix
β”‚ β”‚ β”œβ”€β”€ grug-far.nix
β”‚ β”‚ β”œβ”€β”€ harpoon.nix
β”‚ β”‚ β”œβ”€β”€ illuminate.nix
β”‚ β”‚ β”œβ”€β”€ indent.nix
β”‚ β”‚ β”œβ”€β”€ lz-n.nix
β”‚ β”‚ β”œβ”€β”€ markdown-prev.nix
β”‚ β”‚ β”œβ”€β”€ mini-nvim
β”‚ β”‚ β”‚ β”œβ”€β”€ bracket.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ default.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ files.nix
β”‚ β”‚ β”‚ β”œβ”€β”€ pairs.nix
β”‚ β”‚ β”‚ └── surround.nix
β”‚ β”‚ β”œβ”€β”€ nvim-autopairs.nix
β”‚ β”‚ β”œβ”€β”€ nvim-autotag.nix
β”‚ β”‚ β”œβ”€β”€ nvim_tree.nix
β”‚ β”‚ β”œβ”€β”€ oil.nix
β”‚ β”‚ β”œβ”€β”€ smears-cursor.nix
β”‚ β”‚ β”œβ”€β”€ surround.nix
β”‚ β”‚ β”œβ”€β”€ toggleterm.nix
β”‚ β”‚ β”œβ”€β”€ ufo.nix
β”‚ β”‚ β”œβ”€β”€ undotree.nix
β”‚ β”‚ └── whichkey.nix
β”‚ β”œβ”€β”€ result β†’ /nix/store/ms0wqhixsickm1msyv9ljqd6ids4mk20-nixvim
β”‚ └── settings.nix
β”œβ”€β”€ flake.lock
β”œβ”€β”€ flake.nix
└── result β†’ /nix/store/l61k80ggq3abgxja012wvgfhicr6fj9j-nixvim

thank you, if you need the latest nixvim config to test for yourself you can find it here :slight_smile:
nixvim config github

I can not reproduce your issue, I get already an eval error:

error:
       … while evaluating the attribute 'config.build.package.overrideAttrs'
         at Β«github:NixOS/nixpkgs/ed142ab1b3a092c4d149245d0c4126a5d7ea00b0?narHash=sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS%2B8A%3DΒ»/lib/modules.nix:361:9:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          362|         _module = checked (config._module);

       … while calling the 'seq' builtin
         at Β«github:NixOS/nixpkgs/ed142ab1b3a092c4d149245d0c4126a5d7ea00b0?narHash=sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS%2B8A%3DΒ»/lib/modules.nix:361:18:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          362|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `plugins.clangd-extensions.inlayHints' does not exist. Definition values:
       - In `/nix/store/4ijd368p54h9562vp8rm208p4km15nsi-source/config/plug/lsp/per/clang.nix':
           {
             highlight = "Comment";
             maxLenAlign = false;
             maxLenAlignPadding = 1;
             otherHintsPrefix = "=> ";
           ...

you can set plugins.clangd-extensions = {
enable = false;

in clang.nix file

could you try again after making changes?

I haven’t cloned, I expected your repo to show exactly the error you are asking for help with and nix run github:… it.

PS: the fact that I get an error that you do not get, makes me assume that there are possibly dirty changes or impure shenanigans going on on your side, that make reproducing this issue harder than necessary.

1 Like

i never tried nix run
i have a standalone config for nixvim.
you might be right about it. but, i can’t exactly find the root cause of the error.

Do you have any solutions i could use that might help in debugging ?

Yeah, I am trying to run the linked standalone config. It has a new evaluation error.

error:
       … while evaluating the attribute 'config.build.package.overrideAttrs'
         at Β«github:NixOS/nixpkgs/ed142ab1b3a092c4d149245d0c4126a5d7ea00b0?narHash=sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS%2B8A%3DΒ»/lib/modules.nix:361:9:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          362|         _module = checked (config._module);

       … while calling the 'seq' builtin
         at Β«github:NixOS/nixpkgs/ed142ab1b3a092c4d149245d0c4126a5d7ea00b0?narHash=sha256-dYP3DjiL7oIiiq3H65tGIXXIT1Waiadmv93JS0sS%2B8A%3DΒ»/lib/modules.nix:361:18:
          360|         options = checked options;
          361|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          362|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `plugins.clangd-extensions.memoryUsage' does not exist. Definition values:
       - In `/nix/store/jayq9ckvh6773cdikgg3grk982r1v2im-source/config/plug/lsp/per/clang.nix':
           {
             border = null;
           }

Please fix those. Once you have fixed the linked config, to be actually buildable, we can try to figure out the other issue.

Maybe share exactly what you are currently building. Make sure to not have a dirty tree, make sure to nix run your standalone config.

i am really for all the trouble man, i forgot to remove the old confriguration before copying new ones to git, so all the files that should have been overriden are still floating around and that’s the cause of all this issues

i have just resolved it could you try again

could you now rebuild it , i guess that would just fine.

PS: also nix caching was throwing clang-extension (inlay-hint errors), in that case you could use

nix run --refresh β€˜github:spitfiregg/nixvim’

After setting performance.byteCompileLua.enable = false I get a more reasonable error and generated files are more sane as well.

I was able to debug that into master treesitter stuff and it has been an easy fix, though it might at the same time fail to enable treesitter in some situations.

The changes I made:

diff --git a/config/core/treesitter/treesitter.nix b/config/core/treesitter/treesitter.nix
index 83d39a7d5e..d86f0de474 100644
--- a/config/core/treesitter/treesitter.nix
+++ b/config/core/treesitter/treesitter.nix
@@ -21,7 +21,7 @@
   };

   extraConfigLua = ''
-    local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
+    local parser_config = require("nvim-treesitter").get_available()

     parser_config.liquidsoap = {
       filetype = "liquidsoap",
diff --git a/config/settings.nix b/config/settings.nix
index 9b33c6aca9..d8e96f4807 100644
--- a/config/settings.nix
+++ b/config/settings.nix
@@ -2,7 +2,7 @@
   config = {
     performance = {
       byteCompileLua = {
-        enable = true;
+        enable = false;
         nvimRuntime = true;
         configs = true;
         plugins = true;

PS: your commit history is a mess, that made my attempt of bisecting fail…

1 Like

Right. I do have a commit choas. Let me try that with performance disabled.

Thanks

wow adding the following line actually worked

local parser_config = require("nvim-treesitter").get_available()

I am no longer getting any errors.
thank you.