121 lines
3.5 KiB
Nix
121 lines
3.5 KiB
Nix
{ config, pkgs, pkgs-unstable, lib, user, rice, ... }:
|
|
let
|
|
toLua = str: "lua << EOF\n${str}\nEOF\n";
|
|
toLuaFile = file: "lua << EOF\n${builtins.readFile file}\nEOF\n";
|
|
|
|
theme = {
|
|
name = "base16-colorscheme";
|
|
package = pkgs-unstable.vimPlugins.base16-nvim;
|
|
};
|
|
in
|
|
lib.mkIf (user != "tv")
|
|
{
|
|
home.packages = with pkgs; [
|
|
neovide
|
|
];
|
|
|
|
programs.neovim = {
|
|
enable = true;
|
|
|
|
viAlias = true;
|
|
vimAlias = true;
|
|
vimdiffAlias = true;
|
|
|
|
extraPackages = with pkgs; [
|
|
# extra
|
|
wl-clipboard
|
|
|
|
# LSPs
|
|
nixd
|
|
lua-language-server
|
|
];
|
|
|
|
plugins = with pkgs.vimPlugins; [
|
|
nvim-lspconfig
|
|
nvim-cmp # A completion engine. Completion sources are installed from external repositories and "sourced".
|
|
cmp-nvim-lsp # cmp source: LSPs
|
|
luasnip # cmp source: LSPs
|
|
nvim-web-devicons # icons or some shit
|
|
friendly-snippets # a collention of snippets for many languages
|
|
neodev-nvim # configures lua-language-server for Neovim
|
|
vim-nix # Syntax highlighting, Filetype detection, Automatic indentation, NixEdit command: navigate nixpkgs by attribute name
|
|
telescope-nvim
|
|
telescope-fzf-native-nvim
|
|
lualine-nvim
|
|
comment-nvim
|
|
(nvim-treesitter.withPlugins (p: with p; [
|
|
tree-sitter-nix
|
|
tree-sitter-vim
|
|
tree-sitter-bash
|
|
tree-sitter-lua
|
|
tree-sitter-python
|
|
tree-sitter-json
|
|
tree-sitter-html
|
|
tree-sitter-css
|
|
tree-sitter-dockerfile
|
|
tree-sitter-ssh_config
|
|
tree-sitter-javascript
|
|
tree-sitter-gitignore
|
|
])
|
|
)
|
|
] ++ [ theme.package ];
|
|
|
|
extraLuaConfig = ''
|
|
-- Options
|
|
vim.keymap.set("n", "<Space>", "<Nop>")
|
|
vim.g.mapleader = " "
|
|
vim.g.maplocalleader = ' '
|
|
vim.o.clipboard = 'unnamedplus'
|
|
vim.o.number = true
|
|
vim.o.relativenumber = true
|
|
vim.o.signcolumn = 'yes'
|
|
vim.o.tabstop = 2
|
|
vim.o.shiftwidth = 2
|
|
vim.o.updatetime = 300
|
|
vim.o.termguicolors = true
|
|
vim.o.mouse = 'a'
|
|
|
|
-- Colorscheme
|
|
require('base16-colorscheme').setup({
|
|
base00 = '${rice.color.background}',
|
|
base01 = '${rice.color.bright-black}',
|
|
base02 = '${rice.color.blue}',
|
|
base03 = '${rice.color.bright-blue}',
|
|
base04 = '${rice.color.cyan}',
|
|
base05 = '${rice.color.bright-cyan}',
|
|
base06 = '${rice.color.green}',
|
|
base07 = '${rice.color.bright-green}',
|
|
base08 = '${rice.color.magenta}',
|
|
base09 = '${rice.color.bright-magenta}',
|
|
base0A = '${rice.color.red}',
|
|
base0B = '${rice.color.bright-red}',
|
|
base0C = '${rice.color.foreground}',
|
|
base0D = '${rice.color.bright-white}',
|
|
base0E = '${rice.color.yellow}',
|
|
base0F = '${rice.color.bright-yellow}',
|
|
})
|
|
require('base16-colorscheme').with_config({
|
|
telescope = true,
|
|
-- indentblankline = true,
|
|
-- notify = true,
|
|
-- ts_rainbow = true,
|
|
cmp = true,
|
|
-- illuminate = true,
|
|
-- dapui = true,
|
|
})
|
|
|
|
-- PLUGINS
|
|
require("Comment").setup()
|
|
require("lualine").setup({
|
|
icons_enabled = true,
|
|
theme = '${theme.name}',
|
|
})
|
|
require("Comment").setup()
|
|
${builtins.readFile ./nvim-lua/plugin/lsp.lua}
|
|
${builtins.readFile ./nvim-lua/plugin/cmp.lua}
|
|
${builtins.readFile ./nvim-lua/plugin/telescope.lua}
|
|
${builtins.readFile ./nvim-lua/plugin/treesitter.lua}
|
|
'';
|
|
};
|
|
}
|