56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
|
{ pkgs, lib, config, ... }:
|
||
|
let
|
||
|
cfg = config.snowhawk.neovim;
|
||
|
in
|
||
|
{
|
||
|
options.snowhawk.neovim = {
|
||
|
enable = lib.mkEnableOption "neovim";
|
||
|
package = lib.mkPackageOption pkgs "neovim" {
|
||
|
default = [ "neovim-unwrapped" ];
|
||
|
};
|
||
|
# package = lib.mkOption {
|
||
|
# type = lib.types.package;
|
||
|
# default = pkgs.neovim-unwrapped;
|
||
|
# defaultText = lib.literalExpression "pkgs.neovim-unwrapped";
|
||
|
# description = "The package to use for the neovim binary.";
|
||
|
# };
|
||
|
};
|
||
|
config = lib.mkIf cfg.enable {
|
||
|
programs.neovim =
|
||
|
let
|
||
|
nvim-treesitter = pkgs.vimPlugins.nvim-treesitter;
|
||
|
treesitterWithGrammars = (nvim-treesitter.withPlugins (_: nvim-treesitter.allGrammars));
|
||
|
|
||
|
treesitter-parsers = pkgs.symlinkJoin {
|
||
|
name = "treesitter-parsers";
|
||
|
paths = treesitterWithGrammars.dependencies;
|
||
|
};
|
||
|
in
|
||
|
{
|
||
|
enable = true;
|
||
|
coc.enable = false;
|
||
|
package = cfg.package;
|
||
|
extraLuaConfig = ''
|
||
|
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||
|
require("config.lazy")
|
||
|
|
||
|
vim.g.editorconfig = true
|
||
|
|
||
|
vim.opt.runtimepath:append ("${treesitter-parsers}")
|
||
|
'';
|
||
|
plugins = [
|
||
|
treesitterWithGrammars
|
||
|
];
|
||
|
extraPackages = with pkgs; [
|
||
|
nil
|
||
|
nixpkgs-fmt
|
||
|
rustup
|
||
|
lua-language-server
|
||
|
];
|
||
|
withNodeJs = true;
|
||
|
withPython3 = true;
|
||
|
withRuby = true;
|
||
|
};
|
||
|
};
|
||
|
}
|