(hopefully) fix #65

This commit is contained in:
Pedro Alves 2022-11-08 11:19:38 +00:00
parent 03a80e3da1
commit 1a89cd2107
3 changed files with 108 additions and 20 deletions

View file

@ -87,19 +87,6 @@ in
config =
let
customRC =
(optionalString (config.extraConfigLuaPre != "") ''
${config.extraConfigLuaPre}
'') +
(optionalString (config.extraConfigVim != "") ''
vim.cmd([[
${config.extraConfigVim}
]])
'') +
(optionalString (config.extraConfigLua != "" || config.extraConfigLuaPost != "") ''
${config.extraConfigLua}
${config.extraConfigLuaPost}
'');
defaultPlugin = {
plugin = null;
@ -121,6 +108,25 @@ in
{ nixvim = { start = map (x: x.plugin) normalizedPlugins; opt = [ ]; }; };
});
customRC =
''
vim.cmd([[
${neovimConfig.neovimRcContent}
]])
'' +
(optionalString (config.extraConfigLuaPre != "") ''
${config.extraConfigLuaPre}
'') +
(optionalString (config.extraConfigVim != "") ''
vim.cmd([[
${config.extraConfigVim}
]])
'') +
(optionalString (config.extraConfigLua != "" || config.extraConfigLuaPost != "") ''
${config.extraConfigLua}
${config.extraConfigLuaPost}
'');
extraWrapperArgs = builtins.concatStringsSep " " (
(optional (config.extraPackages != [ ])
''--prefix PATH : "${makeBinPath config.extraPackages}"'')
@ -136,6 +142,6 @@ in
in
{
finalPackage = wrappedNeovim;
initContent = neovimConfig.neovimRcContent;
initContent = customRC;
};
}

12
tests/flake.lock generated
View file

@ -97,12 +97,12 @@
},
"locked": {
"lastModified": 0,
"narHash": "sha256-p/xU46Ew3l56jrG0A+yeRLrOCxRMfAu3JBVvMP0bFUQ=",
"path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source",
"narHash": "sha256-7vhOkX4qovJR5Vm44lk6c81w3DkuGcQTRxGEnRJI8ro=",
"path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source",
"type": "path"
},
"original": {
"path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source",
"path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source",
"type": "path"
}
},
@ -116,12 +116,12 @@
},
"locked": {
"lastModified": 0,
"narHash": "sha256-p/xU46Ew3l56jrG0A+yeRLrOCxRMfAu3JBVvMP0bFUQ=",
"path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source",
"narHash": "sha256-7vhOkX4qovJR5Vm44lk6c81w3DkuGcQTRxGEnRJI8ro=",
"path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source",
"type": "path"
},
"original": {
"path": "/nix/store/h0ngn8s4pvbwifcc7b0waxmhrgkf5d62-source",
"path": "/nix/store/iz74dsm3s96n1f07w6blgw4bf9n2rl5c-source",
"type": "path"
}
},

View file

@ -118,6 +118,88 @@
termguicolors = true;
};
};
issue-65 = build {
colorschemes.gruvbox = {
enable = true;
contrastLight = "hard";
contrastDark = "hard";
};
options = {
number = true;
shiftwidth = 2;
tabstop = 2;
guifont = "FiraCode\ Nerd\ Font\ Mono:h14";
};
plugins = {
lsp = {
enable = true;
servers.rnix-lsp.enable = true;
servers.rust-analyzer.enable = true;
servers.jsonls.enable = true;
};
nvim-tree = {
enable = true;
openOnSetup = true;
openOnTab = true;
};
telescope = {
enable = true;
};
nvim-cmp = {
formatting = {
format = ''
require("lspkind").cmp_format({
mode="symbol",
maxwidth = 50,
ellipsis_char = "..."
})
'';
};
auto_enable_sources = true;
snippet = {
expand = ''
function(args)
require("luasnip").lsp_expand(args.body)
end
'';
};
enable = true;
sources = [
{ name = "nvim_lsp"; }
{
name = "luasnip";
option = {
show_autosnippets = true;
};
}
{ name = "path"; }
{ name = "buffer"; }
];
};
barbar.enable = true;
};
globals.mapleader = " ";
extraPlugins = with pkgs.vimPlugins; [
which-key-nvim
# leap-nvim
vim-flutter
plenary-nvim
fidget-nvim
luasnip
lspkind-nvim
];
# extraConfigLua = (builtins.readFile ./nvim-extra-lua.lua);
};
};
})) // {
nixosConfigurations.nixvim-machine = nixpkgs.lib.nixosSystem {