2024-05-30 03:31:14 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
2024-05-30 06:34:10 +00:00
|
|
|
|
2024-05-30 03:31:14 +00:00
|
|
|
let
|
|
|
|
cfg = config.snowhawk.neovim;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.snowhawk.neovim = {
|
|
|
|
enable = lib.mkEnableOption "neovim";
|
2024-05-30 06:34:10 +00:00
|
|
|
|
2024-05-30 03:31:14 +00:00
|
|
|
package = lib.mkPackageOption pkgs "neovim" {
|
|
|
|
default = [ "neovim-unwrapped" ];
|
|
|
|
};
|
2024-05-30 03:46:02 +00:00
|
|
|
|
|
|
|
# This should be close to identical to above
|
|
|
|
#
|
2024-05-30 03:31:14 +00:00
|
|
|
# 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.";
|
|
|
|
# };
|
|
|
|
};
|
2024-07-22 07:48:31 +00:00
|
|
|
config =
|
|
|
|
let
|
|
|
|
nvim-treesitter = pkgs.vimPlugins.nvim-treesitter;
|
|
|
|
treesitterWithGrammars = nvim-treesitter.withPlugins (_: nvim-treesitter.allGrammars);
|
2024-05-30 22:04:10 +00:00
|
|
|
|
2024-07-22 07:48:31 +00:00
|
|
|
treesitter-parsers = pkgs.symlinkJoin {
|
|
|
|
name = "treesitter-parsers";
|
|
|
|
paths = treesitterWithGrammars.dependencies;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
lib.mkIf cfg.enable {
|
|
|
|
# Set nvim as manpager and default editor
|
|
|
|
home.sessionVariables = {
|
|
|
|
EDITOR = "nvim";
|
|
|
|
MANPAGER = "nvim +Man!";
|
|
|
|
};
|
2024-05-30 03:31:14 +00:00
|
|
|
|
2024-08-08 09:49:59 +00:00
|
|
|
xdg.configFile."nvim/lua/parsers.lua".text = /* lua */ ''
|
2024-07-22 07:48:31 +00:00
|
|
|
vim.opt.runtimepath:append ("${treesitter-parsers}")
|
|
|
|
'';
|
|
|
|
|
|
|
|
programs.neovim = {
|
2024-05-30 03:31:14 +00:00
|
|
|
enable = true;
|
|
|
|
coc.enable = false;
|
|
|
|
package = cfg.package;
|
2024-05-30 06:34:10 +00:00
|
|
|
withNodeJs = true;
|
|
|
|
withPython3 = true;
|
|
|
|
withRuby = true;
|
|
|
|
|
2024-05-30 03:31:14 +00:00
|
|
|
plugins = [
|
|
|
|
treesitterWithGrammars
|
|
|
|
];
|
2024-05-30 06:34:10 +00:00
|
|
|
|
2024-05-30 03:31:14 +00:00
|
|
|
extraPackages = with pkgs; [
|
|
|
|
nil
|
|
|
|
nixpkgs-fmt
|
|
|
|
rustup
|
|
|
|
lua-language-server
|
2024-05-30 06:46:12 +00:00
|
|
|
fzf
|
2024-05-30 03:31:14 +00:00
|
|
|
];
|
|
|
|
};
|
2024-07-22 07:48:31 +00:00
|
|
|
};
|
2024-05-30 03:31:14 +00:00
|
|
|
}
|