I’m using home-manager to manage my dotfiles and binaries and I’m having issues properly configuring my neovim plugins.
This is my nix file for configuring neovim via home manager:
{ vimPlugins }:
let
toLua = str: “lua << EOF\n${str}\nEOF\n”;
toLuaFile = file: “lua << EOF\n${builtins.readFile file}\nEOF\n”;
in
{
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
extraLuaConfig = ‘’
${builtins.readFile ./options.lua}
‘’;
plugins = with vimPlugins; [
{
plugin = hop-nvim;
config = toLuaFile ./hop.lua;
}
{
plugin = telescope-nvim;
config = toLuaFile ./telescope.lua;
}
telescope-fzf-native-nvim
telescope-ui-select-nvim
vim-nix
vim-nix
plenary-nvim
nvim-web-devicons
];
}
– Telescope specific config file:
require(‘telescope’).setup({
extensions = {
fzf = {
fuzzy = true, – false will only do exact matching
override_generic_sorter = true, – override the generic sorter
override_file_sorter = true, – override the file sorter
case_mode = “smart_case”, – or “ignore_case” or “respect_case”
},
[‘ui-select’] = {
require(‘telescope.themes’).get_dropdown(),
}
}
})
local opts = { noremap = true, silent = true }
– See :help telescope.builtin
local builtin = require ‘telescope.builtin’
vim.keymap.set(‘n’, ‘zf’, builtin.find_files, { desc = ‘[S]earch [F]iles’ })
The issue is that my plugins are pulled in and configured before my options.lua file is, which is where my leader is defined. So the following mapping doesn’t work:
vim.keymap.set(‘n’, ‘zf’, builtin.find_files, { desc = ‘[S]earch [F]iles’ })
How can I tell nix to pull in my options config and then my plugins and configure?