neovim.nix

main
Zynh Ludwig 2024-05-29 20:31:14 -07:00
parent fc92f1a5b9
commit f011d8c78d
2 changed files with 61 additions and 38 deletions

View File

@ -2,6 +2,7 @@
{ {
imports = [ imports = [
./home/modules/neovim.nix
./home/modules/git.nix ./home/modules/git.nix
./home/modules/fish.nix ./home/modules/fish.nix
./home/modules/alacritty.nix ./home/modules/alacritty.nix
@ -12,6 +13,11 @@
home.username = "ravenshade"; home.username = "ravenshade";
home.homeDirectory = "/home/ravenshade"; home.homeDirectory = "/home/ravenshade";
snowhawk.neovim = {
enable = true;
package = inputs.neovim-overlay.packages.${pkgs.system}.default;
};
# This value determines the Home Manager release that your configuration is # This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release # compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes. # introduces backwards incompatible changes.
@ -49,44 +55,6 @@
# systemd.enable = true; # systemd.enable = true;
# }; # };
programs.neovim =
let
package = inputs.neovim-overlay.packages.${pkgs.system}.default;
nvim-treesitter = pkgs.vimPlugins.nvim-treesitter;
treesitterWithGrammars = (nvim-treesitter.withPlugins (_: nvim-treesitter.allGrammars));
treesitter-parsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
paths = treesitterWithGrammars.dependencies;
};
in
{
inherit package;
enable = true;
coc.enable = false;
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;
};
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
programs.home-manager.enable = true; programs.home-manager.enable = true;

55
home/modules/neovim.nix Normal file
View File

@ -0,0 +1,55 @@
{ 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;
};
};
}