2024-05-18 20:00:18 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
2024-05-20 21:15:16 +02:00
|
|
|
cfg = config.myConfig.shell.neovim;
|
2024-05-18 20:00:18 +02:00
|
|
|
in {
|
2024-05-20 21:15:16 +02:00
|
|
|
options.myConfig.shell.neovim = {
|
|
|
|
enable = lib.mkEnableOption "neovim";
|
2024-05-18 20:00:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2024-05-26 13:11:21 +02:00
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
2024-08-08 10:27:12 +02:00
|
|
|
vimAlias = true;
|
|
|
|
vimdiffAlias = true;
|
|
|
|
withNodeJs = true;
|
2024-05-26 13:11:21 +02:00
|
|
|
defaultEditor = true;
|
|
|
|
plugins = with pkgs.vimPlugins; [
|
2024-05-26 14:00:59 +02:00
|
|
|
lazy-nvim
|
2024-05-26 13:11:21 +02:00
|
|
|
];
|
2024-08-08 10:27:12 +02:00
|
|
|
|
2024-05-26 14:00:59 +02:00
|
|
|
extraLuaConfig = ''
|
2024-08-08 10:27:12 +02:00
|
|
|
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution
|
|
|
|
-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk.
|
|
|
|
local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
|
|
|
|
if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
|
|
|
|
-- stylua: ignore
|
|
|
|
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
|
|
|
end
|
|
|
|
vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
|
|
|
-- validate that lazy is available
|
|
|
|
if not pcall(require, "lazy") then
|
|
|
|
-- stylua: ignore
|
|
|
|
vim.api.nvim_echo({ { ("Unable to load lazy from: %s\n"):format(lazypath), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
|
|
|
|
vim.fn.getchar()
|
|
|
|
vim.cmd.quit()
|
|
|
|
end
|
|
|
|
|
2024-05-26 14:00:59 +02:00
|
|
|
require "lazy_setup"
|
|
|
|
'';
|
2024-05-26 14:16:38 +02:00
|
|
|
extraPackages = with pkgs; [
|
|
|
|
gnumake
|
|
|
|
clang
|
|
|
|
gcc
|
|
|
|
zig
|
|
|
|
cargo
|
|
|
|
rust-analyzer
|
|
|
|
rustup
|
2024-05-26 14:23:53 +02:00
|
|
|
nodejs
|
2024-09-12 15:56:40 +02:00
|
|
|
nixd
|
|
|
|
alejandra
|
2024-05-26 14:16:38 +02:00
|
|
|
];
|
2024-05-18 20:00:18 +02:00
|
|
|
};
|
2024-05-26 14:00:59 +02:00
|
|
|
|
2024-08-08 10:27:12 +02:00
|
|
|
# home.file.".config/nvim/lua".source = ./nvim-lua;
|
|
|
|
xdg.configFile."nvim/lua" = {
|
|
|
|
recursive = true;
|
|
|
|
source = ./nvim-lua;
|
|
|
|
};
|
2024-05-18 20:00:18 +02:00
|
|
|
};
|
|
|
|
}
|