Initial configuration
This commit is contained in:
commit
294fd9dcf3
35 changed files with 5369 additions and 0 deletions
50
hosts/totsugeki/development/default.nix
Normal file
50
hosts/totsugeki/development/default.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ inputs, pkgs, ... }: {
|
||||
imports = [ ./nixvim ];
|
||||
home = { packages = with pkgs; [ git-credential-manager gnupg pass ]; };
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
credential = {
|
||||
credentialStore = "gpg";
|
||||
helper = "${pkgs.git-credential-manager}/bin/git-credential-manager";
|
||||
"https://codeberg.org".provider = "generic";
|
||||
"https://git.rcia.dev".provider = "generic";
|
||||
};
|
||||
merge.tool = "nvim -d";
|
||||
};
|
||||
signing = {
|
||||
key = "B684FD451B692E04";
|
||||
signByDefault = true;
|
||||
};
|
||||
userEmail = "aveeryy@protonmail.com";
|
||||
userName = "Avery";
|
||||
};
|
||||
lazygit = {
|
||||
enable = true;
|
||||
settings = {
|
||||
gui.theme = {
|
||||
activeBorderColor = [ "#89b4fa" "bold" ];
|
||||
inactiveBorderColor = [ "#a6adc8" ];
|
||||
optionsTextColor = [ "#89b4fa" ];
|
||||
selectedLineBgColor = [ "#313244" ];
|
||||
selectedRangeBgColor = [ "#313244" ];
|
||||
cherryPickedCommitBgColor = [ "#45475a" ];
|
||||
cherryPickedCommitFgColor = [ "#89b4fa" ];
|
||||
unstagedChangesColor = [ "#f38ba8" ];
|
||||
defaultFgColor = [ "#cdd6f4" ];
|
||||
searchingActiveBorderColor = [ "#f9e2af" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
services = {
|
||||
gpg-agent = {
|
||||
defaultCacheTtl = 3600;
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
enableZshIntegration = true;
|
||||
pinentryPackage = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
}
|
104
hosts/totsugeki/development/nixvim/completion.nix
Normal file
104
hosts/totsugeki/development/nixvim/completion.nix
Normal file
|
@ -0,0 +1,104 @@
|
|||
{ inputs, lib, ... }: {
|
||||
programs.nixvim = {
|
||||
extraConfigLua = ''
|
||||
function has_words_before()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0
|
||||
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
function leave_snippet()
|
||||
if
|
||||
((vim.v.event.old_mode == "s" and vim.v.event.new_mode == "n") or vim.v.event.old_mode == "i")
|
||||
and require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()]
|
||||
and not require("luasnip").session.jump_active
|
||||
then
|
||||
require("luasnip").unlink_current()
|
||||
end
|
||||
end
|
||||
|
||||
-- stop snippets when you leave to normal mode
|
||||
vim.api.nvim_command([[
|
||||
autocmd ModeChanged * lua leave_snippet()
|
||||
]])
|
||||
'';
|
||||
plugins = {
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
formatting.format = lib.mkForce ''
|
||||
function(entry, vim_item)
|
||||
if vim.tbl_contains({ "path" }, entry.source.name) then
|
||||
local icon, hl_group =
|
||||
require("nvim-web-devicons").get_icon(entry:get_completion_item().label)
|
||||
if icon then
|
||||
vim_item.kind = icon
|
||||
vim_item.kind_hl_group = hl_group
|
||||
return vim_item
|
||||
end
|
||||
end
|
||||
return require("lspkind").cmp_format({ with_text = true })(entry, vim_item)
|
||||
end
|
||||
'';
|
||||
mapping = {
|
||||
"<CR>" = "cmp.mapping.confirm({ select = false })";
|
||||
"<Tab>" = ''
|
||||
cmp.mapping(
|
||||
function(callback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require("luasnip").expand_or_locally_jumpable() then
|
||||
require("luasnip").expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
callback()
|
||||
end
|
||||
end
|
||||
, {"i", "s"})
|
||||
'';
|
||||
"<S-Tab>" = ''
|
||||
cmp.mapping(
|
||||
function(callback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require("luasnip").jumpable(-1) then
|
||||
require("luasnip").jump(-1)
|
||||
else
|
||||
callback()
|
||||
end
|
||||
end
|
||||
, {"i", "s"})
|
||||
'';
|
||||
};
|
||||
snippet.expand = ''
|
||||
function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
sources = [
|
||||
{
|
||||
name = "luasnip";
|
||||
priority = 40;
|
||||
}
|
||||
{
|
||||
name = "nvim_lsp";
|
||||
priority = 30;
|
||||
entry_filter = ''
|
||||
function(entry, _)
|
||||
return entry:get_kind() ~= require("cmp").lsp.CompletionItemKind.Text
|
||||
end
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
lspkind = { enable = true; };
|
||||
luasnip = {
|
||||
enable = true;
|
||||
fromVscode = [ { } ];
|
||||
};
|
||||
friendly-snippets.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
40
hosts/totsugeki/development/nixvim/default.nix
Normal file
40
hosts/totsugeki/development/nixvim/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ inputs, pkgs, ... }: {
|
||||
imports = [
|
||||
./completion.nix
|
||||
./lsp.nix
|
||||
./neo-tree.nix
|
||||
./none-ls.nix
|
||||
./treesitter.nix
|
||||
];
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
flavour = "mocha";
|
||||
disableItalic = true;
|
||||
integrations = {
|
||||
cmp = true;
|
||||
neotree = true;
|
||||
};
|
||||
};
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
||||
options = {
|
||||
number = true;
|
||||
cursorline = true;
|
||||
tabstop = 4;
|
||||
shiftwidth = 4;
|
||||
expandtab = true;
|
||||
ttyfast = true;
|
||||
wrap = false;
|
||||
mousemoveevent = true;
|
||||
signcolumn = "yes";
|
||||
};
|
||||
|
||||
plugins.nvim-autopairs.enable = true;
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [ nvim-web-devicons ];
|
||||
};
|
||||
}
|
9
hosts/totsugeki/development/nixvim/lsp.nix
Normal file
9
hosts/totsugeki/development/nixvim/lsp.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ inputs, ... }: {
|
||||
programs.nixvim.plugins = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
|
||||
servers = { pyright.enable = true; };
|
||||
};
|
||||
};
|
||||
}
|
1
hosts/totsugeki/development/nixvim/lualine.nix
Normal file
1
hosts/totsugeki/development/nixvim/lualine.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ ... }: { programs.nixvim.plugins.lualine = { enable = true; }; }
|
161
hosts/totsugeki/development/nixvim/neo-tree.nix
Normal file
161
hosts/totsugeki/development/nixvim/neo-tree.nix
Normal file
|
@ -0,0 +1,161 @@
|
|||
{ ... }: {
|
||||
programs.nixvim = {
|
||||
keymaps = [
|
||||
{
|
||||
action = "<cmd>Neotree toggle<CR>";
|
||||
key = "<leader>fi";
|
||||
}
|
||||
];
|
||||
plugins.neo-tree = {
|
||||
enable = true;
|
||||
closeIfLastWindow = true;
|
||||
enableGitStatus = true;
|
||||
enableDiagnostics = true;
|
||||
sourceSelector = {
|
||||
winbar = true;
|
||||
statusline = false;
|
||||
tabsLayout = "equal";
|
||||
sources = [
|
||||
{ source = "filesystem"; displayName = " Archivos "; }
|
||||
];
|
||||
};
|
||||
defaultComponentConfigs = {
|
||||
container = {
|
||||
enableCharacterFade = true;
|
||||
};
|
||||
indent = {
|
||||
indentSize = 2;
|
||||
padding = 1;
|
||||
withMarkers = true;
|
||||
indentMarker = "│";
|
||||
lastIndentMarker = "└";
|
||||
highlight = "NeoTreeIndentMarker";
|
||||
withExpanders = true;
|
||||
expanderCollapsed = "";
|
||||
expanderExpanded = "";
|
||||
expanderHighlight = "NeoTreeExpander";
|
||||
};
|
||||
icon = {
|
||||
folderClosed = "";
|
||||
folderOpen = "";
|
||||
folderEmpty = "";
|
||||
default = " ";
|
||||
highlight = "NeoTreeFileIcon";
|
||||
};
|
||||
modified = {
|
||||
symbol = "[+]";
|
||||
highlight = "NeoTreeModified";
|
||||
};
|
||||
name = {
|
||||
trailingSlash = false;
|
||||
useGitStatusColors = true;
|
||||
highlight = "NeoTreeFileName";
|
||||
};
|
||||
gitStatus = {
|
||||
symbols = {
|
||||
added = "";
|
||||
modified = "";
|
||||
deleted = "";
|
||||
renamed = "";
|
||||
untracked = "";
|
||||
ignored = "";
|
||||
unstaged = "U";
|
||||
staged = "";
|
||||
conflict = "";
|
||||
};
|
||||
};
|
||||
diagnostics = {
|
||||
symbols = {
|
||||
error = "";
|
||||
warn = "";
|
||||
hint = "";
|
||||
info = "";
|
||||
};
|
||||
highlights = {
|
||||
hint = "DiagnosticSignHint";
|
||||
info = "DiagnosticSignInfo";
|
||||
warn = "DiagnosticSignWarn";
|
||||
error = "DiagnosticSignError";
|
||||
};
|
||||
};
|
||||
};
|
||||
window = {
|
||||
position = "left";
|
||||
width = 40;
|
||||
mappingOptions = {
|
||||
noremap = true;
|
||||
nowait = true;
|
||||
};
|
||||
};
|
||||
filesystem = {
|
||||
bindToCwd = true;
|
||||
filteredItems = {
|
||||
visible = false;
|
||||
hideDotfiles = false;
|
||||
hideGitignored = false;
|
||||
hideByName = [
|
||||
"nodeModules"
|
||||
];
|
||||
};
|
||||
groupEmptyDirs = false;
|
||||
useLibuvFileWatcher = true;
|
||||
};
|
||||
buffers = {
|
||||
groupEmptyDirs = true;
|
||||
};
|
||||
renderers = {
|
||||
directory = [
|
||||
"indent"
|
||||
"icon"
|
||||
"current_filter"
|
||||
{
|
||||
name = "container";
|
||||
content = [
|
||||
{
|
||||
name = "name";
|
||||
zindex = 10;
|
||||
}
|
||||
{
|
||||
name = "symlink_target";
|
||||
zindex = 10;
|
||||
highlight = "NeoTreeSymbolicLinkTarget";
|
||||
}
|
||||
{
|
||||
name = "clipboard";
|
||||
zindex = 10;
|
||||
}
|
||||
{
|
||||
name = "diagnostics";
|
||||
errorsOnly = true;
|
||||
zindex = 20;
|
||||
align = "right";
|
||||
hideWhenExpanded = false;
|
||||
}
|
||||
{
|
||||
name = "git_status";
|
||||
zindex = 10;
|
||||
align = "right";
|
||||
hideWhenExpanded = true;
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
file = [
|
||||
"indent"
|
||||
"icon"
|
||||
{
|
||||
name = "container";
|
||||
content = [
|
||||
{ name = "name"; zindex = 10; }
|
||||
{ name = "clipboard"; zindex = 10;}
|
||||
{ name = "bufnr"; zindex = 10;}
|
||||
{ name = "modified"; zindex = 20; align = "right";}
|
||||
{ name = "diagnostics"; zindex = 20; align = "right";}
|
||||
{ name = "git_status"; zindex = 15; align = "right";}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
25
hosts/totsugeki/development/nixvim/none-ls.nix
Normal file
25
hosts/totsugeki/development/nixvim/none-ls.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins.none-ls = {
|
||||
enable = true;
|
||||
onAttach = ''
|
||||
function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ async = false })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
'';
|
||||
sources = {
|
||||
formatting = {
|
||||
black.enable = true;
|
||||
nixfmt.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
7
hosts/totsugeki/development/nixvim/treesitter.nix
Normal file
7
hosts/totsugeki/development/nixvim/treesitter.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins.treesitter = {
|
||||
enable = true;
|
||||
indent = true;
|
||||
nixvimInjections = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue