Reorganize common configuration
This commit is contained in:
parent
b0435707e4
commit
84dfefcb45
18 changed files with 81 additions and 128 deletions
|
@ -1,50 +1 @@
|
|||
{ pkgs, ... }: {
|
||||
home.packages = with pkgs; [ xh gnupg git-credential-manager pass wslu ];
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
extraConfig = {
|
||||
init.defaultBranch = "main";
|
||||
merge.tool = "nvim -d";
|
||||
credential = {
|
||||
credentialStore = "gpg";
|
||||
helper = "${pkgs.git-credential-manager}/bin/git-credential-manager";
|
||||
"https://git.rcia.dev".provider = "generic";
|
||||
};
|
||||
};
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
{ pkgs, ... }: { home.packages = with pkgs; [ python3 xh wslu ]; }
|
||||
|
|
|
@ -1 +1,3 @@
|
|||
{ ... }: { imports = [ ./desktop ./development ./scripts ./autofirma.nix ]; }
|
||||
{ ... }: {
|
||||
imports = [ ./desktop ./development.nix ./scripts ./autofirma.nix ];
|
||||
}
|
||||
|
|
15
hosts/totsugeki/home-manager/development.nix
Normal file
15
hosts/totsugeki/home-manager/development.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, ... }: {
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
android-studio
|
||||
android-tools
|
||||
dotnet-sdk_8
|
||||
mitmproxy
|
||||
python3
|
||||
unityhub
|
||||
xh
|
||||
];
|
||||
sessionVariables = { DOTNET_ROOT = "${pkgs.dotnet-sdk_8}"; };
|
||||
sessionPath = [ "$HOME/.dotnet/tools" ];
|
||||
};
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [ ./nixvim ];
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
android-studio
|
||||
android-tools
|
||||
git-credential-manager
|
||||
gnupg
|
||||
pass
|
||||
dotnet-sdk_8
|
||||
unityhub
|
||||
mitmproxy
|
||||
xh
|
||||
];
|
||||
};
|
||||
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";
|
||||
};
|
||||
init.defaultBranch = "main";
|
||||
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;
|
||||
pinentry.package = pkgs.pinentry-qt;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,104 +0,0 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
./completion.nix
|
||||
./lsp.nix
|
||||
./lualine.nix
|
||||
./neo-tree.nix
|
||||
./none-ls.nix
|
||||
./treesitter.nix
|
||||
./telescope.nix
|
||||
./trouble.nix
|
||||
];
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings = {
|
||||
flavour = "mocha";
|
||||
no_italic = true;
|
||||
transparent_background = true;
|
||||
integrations = {
|
||||
cmp = true;
|
||||
neotree = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
||||
opts = {
|
||||
number = true;
|
||||
cursorline = true;
|
||||
tabstop = 4;
|
||||
shiftwidth = 4;
|
||||
expandtab = true;
|
||||
ttyfast = true;
|
||||
wrap = false;
|
||||
mousemoveevent = true;
|
||||
signcolumn = "yes";
|
||||
};
|
||||
|
||||
plugins = {
|
||||
web-devicons.enable = true;
|
||||
nvim-autopairs.enable = true;
|
||||
};
|
||||
|
||||
extraPlugins = with pkgs.vimPlugins; [ nvim-web-devicons ];
|
||||
};
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
keymaps.lspBuf."<leader>ca" = "code_action";
|
||||
luaConfig.post = ''
|
||||
local signs = {
|
||||
Error = "",
|
||||
Warn = "",
|
||||
Hint = "",
|
||||
Info = ""
|
||||
}
|
||||
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
|
||||
end
|
||||
'';
|
||||
servers = {
|
||||
cssls.enable = true;
|
||||
dartls.enable = true;
|
||||
jdtls.enable = true;
|
||||
nil_ls.enable = true;
|
||||
pyright.enable = true;
|
||||
ts_ls.enable = true;
|
||||
rust_analyzer = {
|
||||
enable = true;
|
||||
installCargo = false;
|
||||
installRustc = false;
|
||||
};
|
||||
svelte.enable = true;
|
||||
volar = {
|
||||
enable = true;
|
||||
tslsIntegration = true;
|
||||
# extraOptions.init_options.vue.hybridMode = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
# nvim-jdtls = {
|
||||
# enable = true;
|
||||
# data = "~/.cache/jdtls/workspace";
|
||||
# };
|
||||
};
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins.lualine = {
|
||||
enable = true;
|
||||
settings.options = {
|
||||
component_separators = {
|
||||
left = "";
|
||||
right = "";
|
||||
};
|
||||
section_separators = {
|
||||
left = "";
|
||||
right = "";
|
||||
};
|
||||
disabled_filetypes.statusline = [ "neo-tree" ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,175 +0,0 @@
|
|||
{ ... }: {
|
||||
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 = "";
|
||||
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";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins.none-ls = {
|
||||
enable = true;
|
||||
settings.on_attach = ''
|
||||
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;
|
||||
dart_format.enable = true;
|
||||
nixfmt.enable = true;
|
||||
prettier = {
|
||||
enable = true;
|
||||
disableTsServerFormatter = true;
|
||||
settings = { extra_filetypes = [ "svelte" ]; };
|
||||
};
|
||||
xmllint.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins.telescope = {
|
||||
enable = true;
|
||||
keymaps = {
|
||||
"<leader>ff" = "find_files";
|
||||
"<leader>bb" = "buffers";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
{ ... }: {
|
||||
programs.nixvim.plugins.treesitter = {
|
||||
enable = true;
|
||||
settings = {
|
||||
indent.enable = true;
|
||||
highlight.enable = true;
|
||||
};
|
||||
nixvimInjections = true;
|
||||
};
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
{ ... }: {
|
||||
programs.nixvim = {
|
||||
plugins.trouble = {
|
||||
enable = true;
|
||||
settings = {
|
||||
auto_refresh = true;
|
||||
focus = true;
|
||||
follow = false;
|
||||
keys = {
|
||||
"<cr>" = "jump_close";
|
||||
"s" = "jump_vsplit";
|
||||
"S" = "jump_split";
|
||||
};
|
||||
win = {
|
||||
type = "float";
|
||||
border = "rounded";
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
action = "<cmd>Trouble diagnostics toggle<cr>";
|
||||
key = "<leader>dg";
|
||||
}
|
||||
{
|
||||
action = "<cmd>Trouble symbols toggle auto_close=true focus=true<cr>";
|
||||
key = "<leader>sy";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue