working on converting app.nix
This commit is contained in:
parent
f50a48a136
commit
826bb47ca5
7 changed files with 545 additions and 125 deletions
|
|
@ -28,12 +28,12 @@
|
|||
};
|
||||
};
|
||||
|
||||
imports = [
|
||||
./plugin/lsp.nix
|
||||
./plugin/nvimcmp.nix
|
||||
./plugin/telescope.nix
|
||||
./plugin/treesitter.nix
|
||||
];
|
||||
# imports = [
|
||||
# ./plugin/lsp.nix
|
||||
# ./plugin/nvimcmp.nix
|
||||
# ./plugin/telescope.nix
|
||||
# ./plugin/treesitter.nix
|
||||
# ];
|
||||
|
||||
config = lib.mkIf config.neovim.enable {
|
||||
home.sessionVariables = {
|
||||
|
|
@ -41,129 +41,114 @@
|
|||
VISUAL = "nvim";
|
||||
};
|
||||
|
||||
programs.neovim = {
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
extraLuaConfig = ''
|
||||
${builtins.readFile ./options.lua}
|
||||
'';
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
(lib.mkIf config.neovim.languages.c.enable libclang)
|
||||
(lib.mkIf config.neovim.languages.go.enable gopls)
|
||||
(lib.mkIf config.neovim.languages.nix.enable nil)
|
||||
(lib.mkIf config.neovim.languages.rust.enable rust-analyzer)
|
||||
];
|
||||
|
||||
# Additional packages are added through imports
|
||||
plugins = let
|
||||
lopts = lib.lists.optionals;
|
||||
cfgp = config.neovim.plugins;
|
||||
cfgl = config.neovim.languages;
|
||||
cfgt = config.neovim.themes;
|
||||
|
||||
comments = lopts cfgp.comments.enable (with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = comment-nvim;
|
||||
type = "lua";
|
||||
config = "require(\"Comment\").setup()";
|
||||
}
|
||||
]);
|
||||
|
||||
fugitive = lopts cfgp.fugitive.enable (with pkgs.vimPlugins; [
|
||||
vim-fugitive
|
||||
]);
|
||||
|
||||
luasnip-pkg = lopts cfgp.luasnip.enable (with pkgs.vimPlugins; [
|
||||
luasnip
|
||||
friendly-snippets
|
||||
(lib.mkIf cfgp.nvimcmp.enable cmp_luasnip)
|
||||
]);
|
||||
|
||||
lualine = lopts cfgp.lualine.enable (with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = lualine-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require("lualine").setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
'' + lib.strings.optionalString cfgt.catppuccin.enable ''
|
||||
theme = "catppuccin"
|
||||
'' + ''
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
||||
nvim-web-devicons
|
||||
]);
|
||||
|
||||
nix-pkg = lopts cfgl.nix.enable (with pkgs.vimPlugins; [
|
||||
vim-nix
|
||||
]);
|
||||
|
||||
rust-pkg = lopts cfgl.rust.enable (with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = rustaceanvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
vim.g.rust_recommended_style = 0
|
||||
'';
|
||||
}
|
||||
]);
|
||||
|
||||
go-pkg = lopts cfgl.go.enable (with pkgs.vimPlugins; [
|
||||
go-nvim
|
||||
]);
|
||||
|
||||
typescript-pkg = lopts cfgl.typescript.enable (with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = typescript-tools-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require("typescript-tools").setup {}
|
||||
'';
|
||||
}
|
||||
]);
|
||||
|
||||
catppuccin-pkg = lopts cfgt.catppuccin.enable (with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = catppuccin-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
vim.cmd.colorscheme "catppuccin-mocha"
|
||||
require('catppuccin').setup({
|
||||
integrations = {
|
||||
'' + lib.strings.optionalString cfgp.wiki.enable ''
|
||||
vimwiki = true
|
||||
'' + ''
|
||||
}
|
||||
})
|
||||
'';
|
||||
}
|
||||
]);
|
||||
|
||||
wiki = lopts cfgp.wiki.enable (with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = vimwiki;
|
||||
type = "lua";
|
||||
config = ''
|
||||
vim.g.vimwiki_list = {
|
||||
{
|
||||
path = '${config.xdg.userDirs.documents}/wiki',
|
||||
links_space_char = '_',
|
||||
ext = '.md',
|
||||
syntax = 'markdown',
|
||||
}
|
||||
}
|
||||
'';
|
||||
}
|
||||
]);
|
||||
in comments ++ fugitive ++ luasnip-pkg ++ lualine ++ nix-pkg ++ rust-pkg
|
||||
++ go-pkg ++ wiki ++ catppuccin-pkg ++ typescript-pkg;
|
||||
};
|
||||
# extraLuaConfig = ''
|
||||
# ${builtins.readFile ./options.lua}
|
||||
# '';
|
||||
|
||||
programs.nixvim.colorschemes = with config.neovim.themes; {
|
||||
catppuccin = lib.mkIf catppuccin.enable {
|
||||
enable = true;
|
||||
flavour = "mocha";
|
||||
integrations.vimwiki = lib.mkIf wiki.enable true;
|
||||
}
|
||||
};
|
||||
|
||||
programs.nixvim.plugins = with config.neovim.plugins; {
|
||||
comment.enable = comments.enable;
|
||||
|
||||
fugitive.enable = fugitive.enable;
|
||||
|
||||
lualine = lib.mkIf lualine.enable {
|
||||
enable = true;
|
||||
icons_enabled = true;
|
||||
};
|
||||
web-devicons.enable = lualine.enable;
|
||||
|
||||
luasnip.enable = luasnip.enable;
|
||||
friendly-snippets.enable = luasnip.enable;
|
||||
|
||||
cmp = {
|
||||
enable = nvimcmp.enable;
|
||||
autoEnableSources = true;
|
||||
settings.sources = lib.options luasnip.enable { name = "cmp-luasnip" };
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
# telescope = {
|
||||
# enable = lib.mkEnableOption "Enables telescope";
|
||||
# fzf.enable = lib.mkEnableOption "Enables telescope-fzf";
|
||||
# };
|
||||
# treesitter.enable = lib.mkEnableOption "Enables treesitter";
|
||||
# wiki.enable = lib.mkEnableOption "Enables a wiki";
|
||||
#
|
||||
#
|
||||
# wiki = lopts cfgp.wiki.enable (with pkgs.vimPlugins; [
|
||||
# {
|
||||
# plugin = vimwiki;
|
||||
# type = "lua";
|
||||
# config = ''
|
||||
# vim.g.vimwiki_list = {
|
||||
# {
|
||||
# path = '${config.xdg.userDirs.documents}/wiki',
|
||||
# links_space_char = '_',
|
||||
# ext = '.md',
|
||||
# syntax = 'markdown',
|
||||
# }
|
||||
# }
|
||||
# '';
|
||||
# }
|
||||
# ]);
|
||||
}
|
||||
|
||||
# extraPackages = with pkgs; [
|
||||
# (lib.mkIf config.neovim.languages.c.enable libclang)
|
||||
# (lib.mkIf config.neovim.languages.go.enable gopls)
|
||||
# (lib.mkIf config.neovim.languages.nix.enable nil)
|
||||
# (lib.mkIf config.neovim.languages.rust.enable rust-analyzer)
|
||||
# ];
|
||||
#
|
||||
# # Additional packages are added through imports
|
||||
# plugins = let
|
||||
# lopts = lib.lists.optionals;
|
||||
# cfgp = config.neovim.plugins;
|
||||
# cfgl = config.neovim.languages;
|
||||
# cfgt = config.neovim.themes;
|
||||
#
|
||||
# nix-pkg = lopts cfgl.nix.enable (with pkgs.vimPlugins; [
|
||||
# vim-nix
|
||||
# ]);
|
||||
#
|
||||
# rust-pkg = lopts cfgl.rust.enable (with pkgs.vimPlugins; [
|
||||
# {
|
||||
# plugin = rustaceanvim;
|
||||
# type = "lua";
|
||||
# config = ''
|
||||
# vim.g.rust_recommended_style = 0
|
||||
# '';
|
||||
# }
|
||||
# ]);
|
||||
#
|
||||
# go-pkg = lopts cfgl.go.enable (with pkgs.vimPlugins; [
|
||||
# go-nvim
|
||||
# ]);
|
||||
#
|
||||
# typescript-pkg = lopts cfgl.typescript.enable (with pkgs.vimPlugins; [
|
||||
# {
|
||||
# plugin = typescript-tools-nvim;
|
||||
# type = "lua";
|
||||
# config = ''
|
||||
# require("typescript-tools").setup {}
|
||||
# '';
|
||||
# }
|
||||
# ]);
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue