forked from foxora/nix
init
This commit is contained in:
commit
a07bd5fd9b
66 changed files with 6115 additions and 0 deletions
10
homes/modules/programs/iamb/config.toml
Normal file
10
homes/modules/programs/iamb/config.toml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[profiles.auroraveon-matrix]
|
||||
user_id = "@auroraveon:matrix.org"
|
||||
url = "https://matrix.org"
|
||||
|
||||
[settings.notifications]
|
||||
enabled = true
|
||||
show_message = false
|
||||
|
||||
[image_preview]
|
||||
protocol.type = "kitty"
|
||||
13
homes/modules/programs/iamb/iamb.nix
Normal file
13
homes/modules/programs/iamb/iamb.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, inputs, lib, pkgs, ... }:
|
||||
let
|
||||
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
inputs.iamb.packages."${stdenv.hostPlatform.system}".default
|
||||
];
|
||||
|
||||
xdg.configFile."iamb/config.toml" = {
|
||||
source = ./config.toml;
|
||||
};
|
||||
}
|
||||
69
homes/modules/programs/neovim/init.lua
Normal file
69
homes/modules/programs/neovim/init.lua
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
vim.opt.termguicolors = true -- use terminal colors
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.wrap = false
|
||||
vim.opt.colorcolumn = "80"
|
||||
|
||||
require("plugins")
|
||||
require("lsp")
|
||||
|
||||
local uv = vim.loop
|
||||
local colorscheme_filepath = "/home/aurora/.cache/nvim/neovim-colors"
|
||||
local colors = {}
|
||||
|
||||
-- function to load colors
|
||||
local function load_colors()
|
||||
local new_colors = {}
|
||||
for line in io.lines(colorscheme_filepath) do
|
||||
table.insert(new_colors, line)
|
||||
end
|
||||
|
||||
-- ensure the table has enough entries to avoid indexing issues
|
||||
if #new_colors >= 18 then
|
||||
colors = new_colors
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = colors[17], base01 = colors[1], base02 = colors[3], base03 = colors[3],
|
||||
base04 = colors[5], base05 = colors[8], base06 = colors[5], base07 = colors[8],
|
||||
base08 = colors[18], base09 = colors[4], base0A = colors[11], base0B = colors[5],
|
||||
base0C = colors[6], base0D = colors[7], base0E = colors[6], base0F = colors[16],
|
||||
})
|
||||
|
||||
-- set colors for blink.cmp's completion menu
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpMenu', { bg = colors[17] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpMenuBorder', { bg = colors[17], fg = colors[13] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpMenuSelection', { bg = colors[15], fg = colors[17] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpScrollBarThumb', { bg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpKind', { bg = colors[17], fg = colors[14] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpLabel', { bg = colors[17], fg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpLabelMatch', { bg = colors[17], fg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpLabelDetail', { bg = colors[17], fg = colors[18] })
|
||||
vim.api.nvim_set_hl(0, 'BlinkCmpLabelDescription', { bg = colors[17], fg = colors[18] })
|
||||
else
|
||||
print("Error: Not enough colors in file")
|
||||
end
|
||||
end
|
||||
|
||||
-- initial load
|
||||
load_colors()
|
||||
|
||||
-- vim.defer_fn(load_colors, 1)
|
||||
|
||||
-- set up a file watcher
|
||||
local function watch_colorscheme()
|
||||
local handle
|
||||
handle = uv.new_fs_event()
|
||||
if handle then
|
||||
uv.fs_event_start(handle, colorscheme_filepath, {}, function(err, _, _)
|
||||
if err then
|
||||
print("Error watching colorscheme file:", err)
|
||||
return
|
||||
end
|
||||
-- debounce by adding a slight delay before reloading
|
||||
vim.defer_fn(load_colors, 100)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
watch_colorscheme()
|
||||
|
||||
59
homes/modules/programs/neovim/lua/lsp/capabilities.lua
Normal file
59
homes/modules/programs/neovim/lua/lsp/capabilities.lua
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
local M = {}
|
||||
|
||||
function M.on_attach(_, bufnr)
|
||||
-- we create a function that lets us more easily define mappings specific
|
||||
-- for LSP related items. It sets the mode, buffer and description for us each time.
|
||||
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
||||
|
||||
-- NOTE: why are these functions that call the telescope builtin?
|
||||
-- because otherwise they would load telescope eagerly when this is defined.
|
||||
-- due to us using the on_require handler to make sure it is available.
|
||||
if nixCats('general.telescope') then
|
||||
nmap('gr', function() require('telescope.builtin').lsp_references() end, '[G]oto [R]eferences')
|
||||
nmap('gI', function() require('telescope.builtin').lsp_implementations() end, '[G]oto [I]mplementation')
|
||||
nmap('<leader>ds', function() require('telescope.builtin').lsp_document_symbols() end, '[D]ocument [S]ymbols')
|
||||
nmap('<leader>ws', function() require('telescope.builtin').lsp_dynamic_workspace_symbols() end, '[W]orkspace [S]ymbols')
|
||||
nmap('<leader>dd', "<cmd>Telescope diagnostics bufnr=0<CR>", '[D]ocument [D]iagnostics')
|
||||
nmap('<leader>wd', "<cmd>Telescope diagnostics<CR>", '[W]orkspace [D]iagnostics')
|
||||
end -- TODO: someone who knows the builtin versions of these to do instead help me out please.
|
||||
|
||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
||||
nmap('<leader>e', vim.diagnostic.open_float, 'Show [E]rror')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||
nmap('<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
|
||||
end
|
||||
|
||||
function M.get(server_name)
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
|
||||
return capabilities
|
||||
end
|
||||
return M
|
||||
88
homes/modules/programs/neovim/lua/lsp/completion.lua
Normal file
88
homes/modules/programs/neovim/lua/lsp/completion.lua
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
return {
|
||||
{
|
||||
"friendly-snippets",
|
||||
dep_of = { "blink.cmp" },
|
||||
},
|
||||
{
|
||||
"blink.cmp",
|
||||
event = { "InsertEnter", "CmdlineEnter" },
|
||||
on_require = "blink",
|
||||
load = function (name)
|
||||
vim.cmd.packadd(name)
|
||||
end,
|
||||
after = function(plugin)
|
||||
local blink = require('blink.cmp')
|
||||
|
||||
blink.setup({
|
||||
keymap = {
|
||||
preset = 'default',
|
||||
},
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = 'mono',
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
providers = {
|
||||
lsp = {
|
||||
name = 'LSP',
|
||||
module = 'blink.cmp.sources.lsp',
|
||||
enabled = true,
|
||||
},
|
||||
path = {
|
||||
name = 'Path',
|
||||
module = 'blink.cmp.sources.path',
|
||||
enabled = true,
|
||||
},
|
||||
snippets = {
|
||||
name = 'Snippets',
|
||||
module = 'blink.cmp.sources.snippets',
|
||||
enabled = true,
|
||||
},
|
||||
buffer = {
|
||||
name = 'Buffer',
|
||||
module = 'blink.cmp.sources.buffer',
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
completion = {
|
||||
accept = {
|
||||
auto_brackets = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
menu = {
|
||||
border = 'rounded',
|
||||
max_height = 12,
|
||||
scrolloff = 2,
|
||||
|
||||
draw = {
|
||||
columns = {
|
||||
{ "kind_icon", gap = 1, },
|
||||
{ "label", "label_description", gap = 1, },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
documentation = {
|
||||
auto_show = false,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
signature = {
|
||||
enabled = true,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
203
homes/modules/programs/neovim/lua/lsp/completion.lua.old
Normal file
203
homes/modules/programs/neovim/lua/lsp/completion.lua.old
Normal file
|
|
@ -0,0 +1,203 @@
|
|||
---packadd + after/plugin
|
||||
---@type fun(names: string[]|string)
|
||||
local load_w_after_plugin = require('nixCatsUtils.lzUtils').make_load_with_after({ "plugin" })
|
||||
|
||||
-- NOTE: packadd doesnt load after directories.
|
||||
-- hence, the above function that you can get from luaUtils that exists to make that easy.
|
||||
|
||||
return {
|
||||
{
|
||||
"cmp-buffer",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp-cmdline",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp-cmdline-history",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp-nvim-lsp",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
dep_of = { "nvim-lspconfig" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp-nvim-lsp-signature-help",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp-nvim-lua",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp-path",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"cmp_luasnip",
|
||||
on_plugin = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"friendly-snippets",
|
||||
dep_of = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"lspkind.nvim",
|
||||
dep_of = { "nvim-cmp" },
|
||||
load = load_w_after_plugin,
|
||||
},
|
||||
{
|
||||
"luasnip",
|
||||
dep_of = { "nvim-cmp" },
|
||||
after = function (plugin)
|
||||
local luasnip = require 'luasnip'
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
luasnip.config.setup {}
|
||||
|
||||
local ls = require('luasnip')
|
||||
|
||||
vim.keymap.set({ "i", "s" }, "<M-n>", function()
|
||||
if ls.choice_active() then
|
||||
ls.change_choice(1)
|
||||
end
|
||||
end)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-cmp",
|
||||
-- cmd = { "" },
|
||||
event = { "DeferredUIEnter" },
|
||||
on_require = { "cmp" },
|
||||
-- ft = "",
|
||||
-- keys = "",
|
||||
-- colorscheme = "",
|
||||
after = function (plugin)
|
||||
-- [[ Configure nvim-cmp ]]
|
||||
-- See `:help cmp`
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
local lspkind = require 'lspkind'
|
||||
|
||||
cmp.setup {
|
||||
formatting = {
|
||||
format = lspkind.cmp_format {
|
||||
mode = 'text',
|
||||
with_text = true,
|
||||
maxwidth = 50, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
|
||||
menu = {
|
||||
buffer = '[BUF]',
|
||||
nvim_lsp = '[LSP]',
|
||||
nvim_lsp_signature_help = '[LSP]',
|
||||
nvim_lsp_document_symbol = '[LSP]',
|
||||
nvim_lua = '[API]',
|
||||
path = '[PATH]',
|
||||
luasnip = '[SNIP]',
|
||||
},
|
||||
},
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-p>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-n>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete {},
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
},
|
||||
|
||||
sources = cmp.config.sources {
|
||||
-- The insertion order influences the priority of the sources
|
||||
{ name = 'nvim_lsp'--[[ , keyword_length = 3 ]] },
|
||||
{ name = 'nvim_lsp_signature_help'--[[ , keyword_length = 3 ]]},
|
||||
{ name = 'path' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
enabled = function()
|
||||
return vim.bo[0].buftype ~= 'prompt'
|
||||
end,
|
||||
experimental = {
|
||||
native_menu = false,
|
||||
ghost_text = false,
|
||||
},
|
||||
}
|
||||
|
||||
cmp.setup.filetype('lua', {
|
||||
sources = cmp.config.sources {
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'nvim_lsp'--[[ , keyword_length = 3 ]]},
|
||||
{ name = 'nvim_lsp_signature_help'--[[ , keyword_length = 3 ]]},
|
||||
{ name = 'path' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'buffer' },
|
||||
},{
|
||||
{
|
||||
name = 'cmdline',
|
||||
option = {
|
||||
ignore_cmds = { 'Man', '!' },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'nvim_lsp_document_symbol'--[[ , keyword_length = 3 ]]},
|
||||
{ name = 'buffer' },
|
||||
{ name = 'cmdline_history' },
|
||||
},
|
||||
view = {
|
||||
entries = { name = 'wildmenu', separator = '|' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources {
|
||||
{ name = 'cmdline' },
|
||||
-- { name = 'cmdline_history' },
|
||||
{ name = 'path' },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
5
homes/modules/programs/neovim/lua/lsp/init.lua
Normal file
5
homes/modules/programs/neovim/lua/lsp/init.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
require("lze").load {
|
||||
{ import = "lsp.completion", },
|
||||
}
|
||||
|
||||
require("lsp.lsp")
|
||||
123
homes/modules/programs/neovim/lua/lsp/lsp.lua
Normal file
123
homes/modules/programs/neovim/lua/lsp/lsp.lua
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
local servers = {}
|
||||
|
||||
servers.lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
formatters = {
|
||||
ignoreComments = false,
|
||||
},
|
||||
signatureHelp = { enable = true },
|
||||
diagnostics = {
|
||||
globals = { 'nixCats', 'vim' },
|
||||
-- disable = { 'missing-fields' },
|
||||
},
|
||||
workspace = {
|
||||
-- make the server aware of the neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
},
|
||||
telemetry = { enabled = false },
|
||||
},
|
||||
}
|
||||
|
||||
local rust_analyzer_cmd = os.getenv("RUST_ANALYZER_CMD")
|
||||
servers.rust_analyzer = {
|
||||
cmd = { rust_analyzer_cmd },
|
||||
settings = {
|
||||
server = {
|
||||
-- For debugging rust-analyzer, to see log location do :LspInfo in neovim
|
||||
-- extraEnv = { {["RA_LOG"]="project_model=debug"} },
|
||||
},
|
||||
cargo = {
|
||||
allFeatures = false,
|
||||
allTargets = false,
|
||||
buildScripts = { enable = true },
|
||||
target = "x86_64-unknown-linux-gnu",
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
servers.zls = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
local elixir_ls_cmd = os.getenv("ELIXIR_LS_CMD")
|
||||
servers.elixirls = {
|
||||
cmd = { elixir_ls_cmd },
|
||||
settings = {},
|
||||
}
|
||||
|
||||
servers.gleam = {
|
||||
settings = {},
|
||||
}
|
||||
|
||||
local java_home = os.getenv("JAVA_HOME")
|
||||
servers.jdtls = {
|
||||
settings = {
|
||||
java = {
|
||||
contentProvider = { preferred = 'fernflower' },
|
||||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = "OpenJDK 17",
|
||||
path = os.getenv("OPENJDK_17"),
|
||||
},
|
||||
{
|
||||
name = "OpenJDK 21",
|
||||
path = os.getenv("OPENJDK_21"),
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
-- Taken from nixCats example:
|
||||
-- If you were to comment out this autocommand
|
||||
-- and instead pass the on attach function directly to
|
||||
-- nvim-lspconfig, it would do the same thing.
|
||||
-- come to think of it, it might be better because then lspconfig doesnt have to be called before lsp attach?
|
||||
-- but you would still end up triggering on a FileType event anyway, so, it makes little difference.
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('nixCats-lsp-attach', { clear = true }),
|
||||
callback = function(event)
|
||||
require('lsp.capabilities').on_attach(vim.lsp.get_client_by_id(event.data.client_id), event.buf)
|
||||
end
|
||||
})
|
||||
|
||||
require("lze").load {
|
||||
{
|
||||
"nvim-lspconfig",
|
||||
event = "FileType",
|
||||
after = function(plugin)
|
||||
-- Just register configs, don't enable yet
|
||||
for server_name, cfg in pairs(servers) do
|
||||
vim.lsp.config(server_name, {
|
||||
capabilities = require('lsp.capabilities').get(server_name),
|
||||
settings = (cfg or {}).settings,
|
||||
filetypes = (cfg or {}).filetypes,
|
||||
cmd = (cfg or {}).cmd,
|
||||
root_pattern = (cfg or {}).root_pattern,
|
||||
})
|
||||
end
|
||||
|
||||
-- Enable on-demand per filetype
|
||||
for server_name, cfg in pairs(servers) do
|
||||
local filetypes = cfg.filetypes or vim.lsp.config[server_name].filetypes
|
||||
if filetypes then
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = filetypes,
|
||||
callback = function()
|
||||
vim.lsp.enable(server_name)
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
135
homes/modules/programs/neovim/lua/nixCatsUtils/lzUtils.lua
Normal file
135
homes/modules/programs/neovim/lua/nixCatsUtils/lzUtils.lua
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
--[[
|
||||
This directory is the luaUtils template.
|
||||
You can choose what things from it that you would like to use.
|
||||
And then delete the rest.
|
||||
Everything in this directory is optional.
|
||||
--]]
|
||||
|
||||
local M = {}
|
||||
-- NOTE: This file contains 2 utilities for making good use of lze and lz.n with nixCats
|
||||
-- The function for loading after directories is useful for both plugins, and also for lazy loading without a plugin,
|
||||
-- but the custom handler will only work with lze.
|
||||
-- If you dont use these plugins, you probably don't need this file.
|
||||
|
||||
---This function is useful for sourcing the after directories of lazily loaded plugins
|
||||
---because vim.cmd.packadd does not do this for you.
|
||||
---
|
||||
---This might be useful when doing lazy loading the vanilla way
|
||||
---as well as when using plugins like lz.n for lazy loading
|
||||
---It is primarily useful for lazily loading nvim-cmp sources,
|
||||
---as they often rely on the after directory to work
|
||||
---
|
||||
---Recieves the names of directories from a plugin's after directory
|
||||
---that you wish to source files from.
|
||||
---Will return a load function that can take a name, or list of names,
|
||||
---and will load a plugin and its after directories.
|
||||
---The function returned is a suitable substitute for the load field of a plugin spec.
|
||||
---
|
||||
---Only makes sense for plugins added via optionalPlugins
|
||||
---or some other opt directory on your packpath
|
||||
---
|
||||
---e.g. in the following example:
|
||||
---load_with_after_plugin will load the plugin names it is given, and their after/plugin dir
|
||||
---
|
||||
---local load_with_after_plugin = require('nixCatsUtils').make_load_with_after({ 'plugin' })
|
||||
---load_with_after_plugin('some_plugin')
|
||||
---@overload fun(dirs: string[]|string): fun(names: string|string[])
|
||||
---It also optionally recieves a function that should load a plugin and return its path
|
||||
---for if the plugin is not on the packpath, or return nil
|
||||
---to load from the packpath or nixCats list as normal
|
||||
---@overload fun(dirs: string[]|string, load: fun(name: string):string|nil): fun(names: string|string[])
|
||||
function M.make_load_with_after(dirs, load)
|
||||
dirs = (type(dirs) == "table" and dirs) or { dirs }
|
||||
local fromPackpath = function(name)
|
||||
for _, packpath in ipairs(vim.opt.packpath:get()) do
|
||||
local plugin_path = vim.fn.globpath(packpath, "pack/*/opt/" .. name, nil, true, true)
|
||||
if plugin_path[1] then
|
||||
return plugin_path[1]
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
---@param plugin_names string[]|string
|
||||
return function(plugin_names)
|
||||
local names = type(plugin_names) == "table" and plugin_names or { plugin_names }
|
||||
local to_source = {}
|
||||
for _, name in ipairs(names) do
|
||||
if type(name) == "string" then
|
||||
local path = (type(load) == "function" and load(name)) or nil
|
||||
if type(path) == "string" then
|
||||
table.insert(to_source, { name = name, path = path })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.packadd, name)
|
||||
if ok then
|
||||
table.insert(to_source, { name = name, path = nil })
|
||||
else
|
||||
vim.notify(
|
||||
'"packadd '
|
||||
.. name
|
||||
.. '" failed, and path provided by custom load function (if provided) was not a string\n'
|
||||
.. err,
|
||||
vim.log.levels.WARN,
|
||||
{ title = "nixCatsUtils.load_with_after" }
|
||||
)
|
||||
end
|
||||
end
|
||||
else
|
||||
vim.notify(
|
||||
"plugin name was not a string and was instead of value:\n" .. vim.inspect(name),
|
||||
vim.log.levels.WARN,
|
||||
{ title = "nixCatsUtils.load_with_after" }
|
||||
)
|
||||
end
|
||||
end
|
||||
for _, info in pairs(to_source) do
|
||||
local plugpath = info.path or vim.tbl_get(package.loaded, "nixCats", "pawsible", "allPlugins", "opt", info.name) or fromPackpath(info.name)
|
||||
if type(plugpath) == "string" then
|
||||
local afterpath = plugpath .. "/after"
|
||||
for _, dir in ipairs(dirs) do
|
||||
if vim.fn.isdirectory(afterpath) == 1 then
|
||||
local plugin_dir = afterpath .. "/" .. dir
|
||||
if vim.fn.isdirectory(plugin_dir) == 1 then
|
||||
local files = vim.fn.glob(plugin_dir .. "/*", false, true)
|
||||
for _, file in ipairs(files) do
|
||||
if vim.fn.filereadable(file) == 1 then
|
||||
vim.cmd("source " .. file)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- A nixCats specific lze handler that you can use to conditionally enable by category easier.
|
||||
-- at the start of your config, register with
|
||||
-- require('lze').register_handlers(require('nixCatsUtils.lzUtils').for_cat)
|
||||
-- before any calls to require('lze').load using the handler have been made.
|
||||
-- accepts:
|
||||
-- for_cat = { "your" "cat" }; for_cat = { cat = { "your" "cat" }, default = bool }
|
||||
-- for_cat = "your.cat"; for_cat = { cat = "your.cat", default = bool }
|
||||
-- where default is an alternate value for when nixCats was NOT used to install the config
|
||||
M.for_cat = {
|
||||
spec_field = "for_cat",
|
||||
set_lazy = false,
|
||||
modify = function(plugin)
|
||||
if type(plugin.for_cat) == "table" then
|
||||
if plugin.for_cat.cat ~= nil then
|
||||
if vim.g[ [[nixCats-special-rtp-entry-nixCats]] ] ~= nil then
|
||||
plugin.enabled = (nixCats(plugin.for_cat.cat) and true) or false
|
||||
else
|
||||
plugin.enabled = nixCats(plugin.for_cat.default)
|
||||
end
|
||||
else
|
||||
plugin.enabled = (nixCats(plugin.for_cat) and true) or false
|
||||
end
|
||||
else
|
||||
plugin.enabled = (nixCats(plugin.for_cat) and true) or false
|
||||
end
|
||||
return plugin
|
||||
end,
|
||||
}
|
||||
|
||||
return M
|
||||
5
homes/modules/programs/neovim/lua/plugins/dressing.lua
Normal file
5
homes/modules/programs/neovim/lua/plugins/dressing.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"dressing.nvim"
|
||||
},
|
||||
}
|
||||
15
homes/modules/programs/neovim/lua/plugins/fyler.lua
Normal file
15
homes/modules/programs/neovim/lua/plugins/fyler.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
{
|
||||
"fyler.nvim",
|
||||
cmd = { "Fyler" },
|
||||
keys = {
|
||||
{ "<leader>tf", function() return require('fyler').toggle({ kind = "split_right" }) end, mode = {"n"}, desc = 'Open [F]yler' },
|
||||
},
|
||||
load = function (name)
|
||||
vim.cmd.packadd(name)
|
||||
end,
|
||||
after = function(plugin)
|
||||
local fyler = require("fyler").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
8
homes/modules/programs/neovim/lua/plugins/init.lua
Normal file
8
homes/modules/programs/neovim/lua/plugins/init.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
require("lze").load {
|
||||
{ import = "plugins.dressing", },
|
||||
{ import = "plugins.telescope", },
|
||||
{ import = "plugins.treesitter", },
|
||||
{ import = "plugins.fyler", },
|
||||
{ import = "plugins.mini-hipatterns", },
|
||||
--{ import = "plugins.neocord", },
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
return {
|
||||
{
|
||||
"mini.hipatterns",
|
||||
after = function(plugin)
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
|
||||
-- Returns hex color group for matching short hex color.
|
||||
--
|
||||
---@param match string
|
||||
---@return string
|
||||
local hex_color_short = function(_, match)
|
||||
local style = 'fg' -- 'fg' or 'bg', for extmark_opts_inline use 'fg'
|
||||
local r, g, b = match:sub(2, 2), match:sub(3, 3), match:sub(4, 4)
|
||||
local hex = string.format('#%s%s%s%s%s%s', r, r, g, g, b, b)
|
||||
return hipatterns.compute_hex_color_group(hex, style)
|
||||
end
|
||||
|
||||
-- Returns hex color group for matching alpha hex color.
|
||||
--
|
||||
---@param match string
|
||||
---@return string
|
||||
local hex_color_alpha = function(_, match)
|
||||
local style = 'fg' -- 'fg' or 'bg', for extmark_opts_inline use 'fg'
|
||||
local r, g, b = match:sub(2, 3), match:sub(4, 5), match:sub(6, 7)
|
||||
local hex = string.format('#%s%s%s', r, g, b)
|
||||
return hipatterns.compute_hex_color_group(hex, style)
|
||||
end
|
||||
|
||||
-- Returns extmark opts for highlights with virtual inline text.
|
||||
--
|
||||
---@param data table Includes `hl_group`, `full_match` and more.
|
||||
---@return table
|
||||
local extmark_opts_inline = function(_, _, data)
|
||||
return {
|
||||
virt_text = { { '', data.hl_group } },
|
||||
virt_text_pos = 'inline',
|
||||
right_gravity = false,
|
||||
}
|
||||
end
|
||||
|
||||
-- Returns extmark opts for highlights with virtual inline text.
|
||||
--
|
||||
---@param data table Includes `hl_group`, `full_match` and more.
|
||||
---@return table
|
||||
local extmark_opts_inline_alpha = function(_, _, data)
|
||||
return {
|
||||
virt_text = { { '', data.hl_group } },
|
||||
virt_text_pos = 'inline',
|
||||
right_gravity = false,
|
||||
}
|
||||
end
|
||||
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- #rrggbb
|
||||
hex_color = hipatterns.gen_highlighter.hex_color({
|
||||
style = "inline",
|
||||
inline_text = '',
|
||||
}),
|
||||
-- #rgb
|
||||
hex_color_short = {
|
||||
pattern = "#%x%x%x%f[%X]",
|
||||
group = hex_color_short,
|
||||
extmark_opts = extmark_opts_inline,
|
||||
},
|
||||
-- #rrggbbaa
|
||||
hex_color_alpha = {
|
||||
pattern = "#%x%x%x%x%x%x%x%x%f[%X]",
|
||||
group = hex_color_alpha,
|
||||
extmark_opts = extmark_opts_inline_alpha,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
5
homes/modules/programs/neovim/lua/plugins/neocord.lua
Normal file
5
homes/modules/programs/neovim/lua/plugins/neocord.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
{
|
||||
"neocord",
|
||||
},
|
||||
}
|
||||
36
homes/modules/programs/neovim/lua/plugins/telescope.lua
Normal file
36
homes/modules/programs/neovim/lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
return {
|
||||
{
|
||||
"telescope.nvim",
|
||||
cmd = { "Telescope" },
|
||||
keys = {
|
||||
{ "<leader>f", function() return require('telescope.builtin').find_files() end, mode = {"n"}, desc = 'Telescope search [F]iles' },
|
||||
{ "<leader>tr", function() return require('telescope.builtin').oldfiles() end, mode = {"n"}, desc = '[T]elescope search [R]ecent files' },
|
||||
{ "<leader>ts", function() return require('telescope.builtin').live_grep() end, mode = {"n"}, desc = '[T]elescope [S]earch cwd with grep' },
|
||||
{ "<leader>tw", function() return require('telescope.builtin').grep_string() end, mode = {"n"}, desc = '[T]elescope search current [W]ord' },
|
||||
{ "<leader>tk", function() return require('telescope.builtin').keymaps() end, mode = {"n"}, desc = '[T]elescope search [K]eymaps' },
|
||||
{ "<leader>tb", function() return require('telescope.builtin').buffers() end, mode = {"n"}, desc = '[T]elescope search [B]uffers' },
|
||||
},
|
||||
load = function (name)
|
||||
vim.cmd.packadd(name)
|
||||
vim.cmd.packadd("telescope-fzf-native.nvim")
|
||||
end,
|
||||
after = function(plugin)
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pcall(telescope.load_extension, "fzf")
|
||||
end,
|
||||
},
|
||||
}
|
||||
95
homes/modules/programs/neovim/lua/plugins/treesitter.lua
Normal file
95
homes/modules/programs/neovim/lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
-- to help me write this after nvim-treesitter updated, i used:
|
||||
-- https://github.com/BirdeeHub/nixCats-nvim/blob/3c9bc4d7123e1b48d92f25ba505b889af541e897/templates/example/lua/myLuaConf/plugins/treesitter.lua
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter",
|
||||
lazy = false,
|
||||
after = function (plugin)
|
||||
--@param buf integer
|
||||
--@param language string
|
||||
local function treesitter_try_attach(buf, language)
|
||||
--check if parser exists and load it
|
||||
if not vim.treesitter.language.add(language) then
|
||||
return
|
||||
end
|
||||
|
||||
-- enables syntax highlight and other treesitter features
|
||||
vim.treesitter.start(buf, language)
|
||||
|
||||
-- enables treesitter based folds
|
||||
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"
|
||||
|
||||
-- enables treesiter based indentation
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end
|
||||
|
||||
local available_parsers = require("nvim-treesitter").get_available()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function(args)
|
||||
local buf, filetype = args.buf, args.match
|
||||
local language = vim.treesitter.language.get_lang(filetype)
|
||||
if not language then
|
||||
return
|
||||
end
|
||||
|
||||
local installed_parsers = require("nvim-treesitter").get_installed("parsers")
|
||||
|
||||
if vim.tbl_contains(installed_parsers, language) then
|
||||
-- enable the parser if it is installed
|
||||
treesitter_try_attach(buf, language)
|
||||
elseif vim.tbl_contains(available_parsers, language) then
|
||||
-- if a parser is available in `nvim-treesitter` enable it after ensuring it is installed
|
||||
require("nvim-treesitter").install(language):await(function()
|
||||
treesitter_try_attach(buf, language)
|
||||
end)
|
||||
else
|
||||
-- try to enable treesitter features in case the parser exists but is not available from `nvim-treesitter`
|
||||
treesitter_try_attach(buf, language)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter-textobjects",
|
||||
lazy = false,
|
||||
before = function(plugin)
|
||||
vim.g.no_plugin_maps = true
|
||||
end,
|
||||
after = function(plugin)
|
||||
require("nvim-treesitter-textobjects").setup {
|
||||
select = {
|
||||
lookahead = true,
|
||||
selection_modes = {
|
||||
['@parameter.outer'] = 'v', -- charwise
|
||||
['@function.outer'] = 'V', -- linewise
|
||||
},
|
||||
include_surrounding_whitespace = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- keymaps
|
||||
vim.keymap.set({ "x", "o" }, "am", function()
|
||||
require "nvim-treesitter-textobjects.select".select_textobject("@function.outer", "textobjects")
|
||||
end)
|
||||
vim.keymap.set({ "x", "o" }, "im", function()
|
||||
require "nvim-treesitter-textobjects.select".select_textobject("@function.inner", "textobjects")
|
||||
end)
|
||||
vim.keymap.set({ "x", "o" }, "ac", function()
|
||||
require "nvim-treesitter-textobjects.select".select_textobject("@class.outer", "textobjects")
|
||||
end)
|
||||
vim.keymap.set({ "x", "o" }, "ic", function()
|
||||
require "nvim-treesitter-textobjects.select".select_textobject("@class.inner", "textobjects")
|
||||
end)
|
||||
-- You can also use captures from other query groups like `locals.scm`
|
||||
vim.keymap.set({ "x", "o" }, "as", function()
|
||||
require "nvim-treesitter-textobjects.select".select_textobject("@local.scope", "locals")
|
||||
end)
|
||||
|
||||
-- NOTE: for more textobjects options, see the following link.
|
||||
-- This template is using the new `main` branch of the repo.
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter-textobjects/tree/main
|
||||
end,
|
||||
},
|
||||
}
|
||||
213
homes/modules/programs/neovim/nixcats.nix
Normal file
213
homes/modules/programs/neovim/nixcats.nix
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
{ config, lib, inputs, upkgs, ... }: let
|
||||
utils = inputs.nixcats.utils;
|
||||
in {
|
||||
imports = [
|
||||
inputs.nixcats.homeModule
|
||||
];
|
||||
|
||||
config = {
|
||||
# this value, nixCats is the defaultPackageName you pass to mkNixosModules
|
||||
# it will be the namespace for your options.
|
||||
nixCats = {
|
||||
enable = true;
|
||||
nixpkgs_version = inputs.nixpkgs;
|
||||
# this will add the overlays from ./overlays and also,
|
||||
# add any plugins in inputs named "plugins-pluginName" to pkgs.neovimPlugins
|
||||
# It will not apply to overall system, just nixCats.
|
||||
addOverlays = /* (import ./overlays inputs) ++ */ [
|
||||
(utils.standardPluginOverlay inputs)
|
||||
];
|
||||
# see the packageDefinitions below.
|
||||
# This says which of those to install.
|
||||
packageNames = [ "auroranvim" ];
|
||||
|
||||
luaPath = "${./.}";
|
||||
|
||||
# the .replace vs .merge options are for modules based on existing configurations,
|
||||
# they refer to how multiple categoryDefinitions get merged together by the module.
|
||||
# for useage of this section, refer to :h nixCats.flake.outputs.categories
|
||||
categoryDefinitions.replace = ({ pkgs, settings, categories, extra, name, mkNvimPlugin, ... }@packageDef: {
|
||||
lspsAndRuntimeDeps = {
|
||||
general = with pkgs; [
|
||||
ripgrep
|
||||
fd
|
||||
];
|
||||
treesitter = with pkgs; [
|
||||
tree-sitter
|
||||
];
|
||||
lang = with pkgs; {
|
||||
lua = [
|
||||
lua-language-server
|
||||
];
|
||||
nix = [
|
||||
nil
|
||||
nix-doc
|
||||
];
|
||||
rust = with pkgs; [
|
||||
cargo
|
||||
rust-analyzer
|
||||
];
|
||||
zig = with pkgs; [
|
||||
upkgs.zls # FIX: using upkgs version as zls is broken rn ;-;
|
||||
];
|
||||
elixir = with pkgs; [
|
||||
elixir-ls
|
||||
];
|
||||
gleam = with pkgs; [
|
||||
gleam
|
||||
];
|
||||
java = with pkgs; [
|
||||
jdt-language-server
|
||||
javaPackages.compiler.openjdk17
|
||||
javaPackages.compiler.openjdk21
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
startupPlugins = {
|
||||
general = with pkgs.vimPlugins; [
|
||||
lze
|
||||
plenary-nvim
|
||||
nvim-notify
|
||||
nvim-web-devicons
|
||||
base16-nvim
|
||||
mini-nvim
|
||||
];
|
||||
treesitter = with pkgs.vimPlugins; [
|
||||
nvim-treesitter-textobjects
|
||||
nvim-treesitter.withAllGrammars
|
||||
];
|
||||
};
|
||||
optionalPlugins = {
|
||||
general = with pkgs.vimPlugins; [
|
||||
];
|
||||
ui = with pkgs.vimPlugins; [
|
||||
dressing-nvim
|
||||
];
|
||||
qol = with pkgs.vimPlugins; [
|
||||
undotree
|
||||
mini-hipatterns
|
||||
];
|
||||
telescope = with pkgs.vimPlugins; [
|
||||
telescope-nvim
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
];
|
||||
fyler = with pkgs.vimPlugins; [
|
||||
fyler-nvim
|
||||
];
|
||||
lsp = with pkgs.vimPlugins; [
|
||||
nvim-lspconfig
|
||||
];
|
||||
completion = with pkgs.vimPlugins; [
|
||||
blink-cmp
|
||||
nvim-cmp
|
||||
luasnip
|
||||
friendly-snippets
|
||||
cmp_luasnip
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
cmp-nvim-lua
|
||||
cmp-nvim-lsp
|
||||
cmp-cmdline
|
||||
cmp-nvim-lsp-signature-help
|
||||
cmp-cmdline-history
|
||||
lspkind-nvim
|
||||
];
|
||||
lang = with pkgs.vimPlugins; {
|
||||
java = [
|
||||
nvim-jdtls
|
||||
];
|
||||
};
|
||||
discord = with pkgs.vimPlugins; [
|
||||
neocord # discord presence plugin :3
|
||||
];
|
||||
};
|
||||
|
||||
# shared libraries to be added to LD_LIBRARY_PATH
|
||||
# variable available to nvim runtime
|
||||
sharedLibraries = {
|
||||
general = with pkgs; [
|
||||
# libgit2
|
||||
];
|
||||
};
|
||||
environmentVariables = {
|
||||
lang = {
|
||||
rust = {
|
||||
# it literally won't see the rust-analyzer provided to it
|
||||
# if you don't use an envrionment variable to tell it
|
||||
RUST_ANALYZER_CMD = "${pkgs.rust-analyzer}/bin/rust-analyzer";
|
||||
};
|
||||
elixir = {
|
||||
ELIXIR_LS_CMD = "${pkgs.elixir-ls}/scripts/language_server.sh";
|
||||
};
|
||||
java = {
|
||||
JAVA_HOME = "${pkgs.javaPackages.compiler.openjdk17}";
|
||||
OPENJDK_17 = "${pkgs.javaPackages.compiler.openjdk17}";
|
||||
OPENJDK_21 = "${pkgs.javaPackages.compiler.openjdk21}";
|
||||
};
|
||||
};
|
||||
};
|
||||
extraWrapperArgs = {
|
||||
test = [
|
||||
'' --set CATTESTVAR2 "It worked again!"''
|
||||
];
|
||||
};
|
||||
# lists of the functions you would have passed to
|
||||
# python.withPackages or lua.withPackages
|
||||
|
||||
# get the path to this python environment
|
||||
# in your lua config via
|
||||
# vim.g.python3_host_prog
|
||||
# or run from nvim terminal via :!<packagename>-python3
|
||||
extraPython3Packages = {
|
||||
test = (_:[]);
|
||||
};
|
||||
# populates $LUA_PATH and $LUA_CPATH
|
||||
extraLuaPackages = {
|
||||
test = [ (_:[]) ];
|
||||
};
|
||||
});
|
||||
|
||||
# see :help nixCats.flake.outputs.packageDefinitions
|
||||
packageDefinitions.replace = {
|
||||
# these are the names of your packages
|
||||
# you can include as many as you wish.
|
||||
auroranvim = {pkgs , ... }: {
|
||||
# they contain a settings set defined above
|
||||
# see :help nixCats.flake.outputs.settings
|
||||
settings = {
|
||||
wrapRc = true;
|
||||
# IMPORTANT:
|
||||
# your alias may not conflict with your other packages.
|
||||
aliases = [ "auroravim" "auravim" "foxyvim" "avix" "fvix" "auim" ];
|
||||
};
|
||||
# and a set of categories that you want
|
||||
# (and other information to pass to lua)
|
||||
categories = {
|
||||
general = true;
|
||||
|
||||
ui = true;
|
||||
qol = true;
|
||||
telescope = true;
|
||||
fyler = true;
|
||||
lsp = true;
|
||||
completion = true;
|
||||
treesitter = true;
|
||||
discord = false;
|
||||
|
||||
lang = {
|
||||
lua = true;
|
||||
nix = true;
|
||||
rust = true;
|
||||
zig = true;
|
||||
elixir = true;
|
||||
gleam = true;
|
||||
java = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
250
homes/modules/programs/nixcord.nix
Normal file
250
homes/modules/programs/nixcord.nix
Normal file
|
|
@ -0,0 +1,250 @@
|
|||
{ config, inputs, lib, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.nixcord.homeModules.nixcord
|
||||
];
|
||||
|
||||
programs.nixcord = {
|
||||
enable = true;
|
||||
equibop.enable = true;
|
||||
|
||||
discord = {
|
||||
vencord.enable = false;
|
||||
equicord.enable = true;
|
||||
};
|
||||
|
||||
config = {
|
||||
enabledThemes = [
|
||||
"aurorastheme.css"
|
||||
"base16-colors.css"
|
||||
];
|
||||
plugins = {
|
||||
anonymiseFileNames = {
|
||||
enable = true;
|
||||
anonymiseByDefault = true;
|
||||
method = 0;
|
||||
randomisedLength = 16;
|
||||
};
|
||||
betterSessions = {
|
||||
backgroundCheck = true;
|
||||
checkInterval = 1;
|
||||
};
|
||||
biggerStreamPreview.enable = true;
|
||||
callTimer.enable = true;
|
||||
fixYoutubeEmbeds.enable = true;
|
||||
fixSpotifyEmbeds.enable = true;
|
||||
tidalEmbeds.enable = true;
|
||||
youtubeAdblock.enable = true;
|
||||
followVoiceUser.enable = true;
|
||||
friendsSince.enable = true;
|
||||
ircColors = {
|
||||
enable = true;
|
||||
lightness = 80;
|
||||
memberListColors = true;
|
||||
applyColorOnlyInDms = false;
|
||||
applyColorOnlyToUsersWithoutColor = false;
|
||||
};
|
||||
messageLogger = {
|
||||
enable = true;
|
||||
showEditDiffs = true;
|
||||
separatedDiffs = false;
|
||||
};
|
||||
fakeNitro.enable = true;
|
||||
ghosted.enable = true;
|
||||
noF1.enable = true;
|
||||
noMaskedUrlPaste.enable = true;
|
||||
messageLatency = {
|
||||
enable = false;
|
||||
latency = -1;
|
||||
showMillis = true;
|
||||
};
|
||||
openInApp.enable = true;
|
||||
crashHandler.enable = true;
|
||||
disableCallIdle.enable = true;
|
||||
experiments.enable = true;
|
||||
expressionCloner.enable = true;
|
||||
favoriteGifSearch.enable = true;
|
||||
fixImagesQuality.enable = true;
|
||||
forceOwnerCrown.enable = true;
|
||||
forwardAnywhere.enable = true;
|
||||
spotifyCrack.enable = true;
|
||||
spotifyShareCommands.enable = true;
|
||||
spotifyControls.enable = true;
|
||||
fullUserInChatbox.enable = true;
|
||||
gifPaste.enable = true;
|
||||
ignoreActivities = {
|
||||
enable = true;
|
||||
ignorePlaying = true;
|
||||
ignoreStreaming = true;
|
||||
ignoreListening = true;
|
||||
ignoreWatching = true;
|
||||
ignoreCompeting = true;
|
||||
};
|
||||
imageLink.enable = true;
|
||||
imageZoom.enable = true;
|
||||
memberCount.enable = true;
|
||||
noDevtoolsWarning.enable = true;
|
||||
noUnblockToJump.enable = true;
|
||||
pauseInvitesForever.enable = true;
|
||||
permissionsViewer.enable = true;
|
||||
pictureInPicture = {
|
||||
enable = true;
|
||||
loop = true;
|
||||
};
|
||||
platformIndicators.enable = true;
|
||||
previewMessage.enable = true;
|
||||
relationshipNotifier.enable = true;
|
||||
revealAllSpoilers.enable = true;
|
||||
serverInfo.enable = true;
|
||||
serverListIndicators.enable = true;
|
||||
showHiddenChannels.enable = true;
|
||||
showHiddenThings.enable = true;
|
||||
showTimeoutDuration = {
|
||||
enable = true;
|
||||
displayStyle = "tooltip";
|
||||
};
|
||||
silentTyping = {
|
||||
enable = true;
|
||||
enabledGlobally = false;
|
||||
};
|
||||
startupTimings.enable = true;
|
||||
typingIndicator.enable = true;
|
||||
unlockedAvatarZoom = {
|
||||
enable = true;
|
||||
zoomMultiplier = 4.0;
|
||||
};
|
||||
userMessagesPronouns.enable = true;
|
||||
validUser.enable = true;
|
||||
validReply.enable = true;
|
||||
viewIcons = {
|
||||
enable = true;
|
||||
format = "webp";
|
||||
imgSize = "4096";
|
||||
};
|
||||
voiceChatDoubleClick.enable = true;
|
||||
voiceDownload.enable = true;
|
||||
voiceMessages = {
|
||||
enable = true;
|
||||
noiseSuppression = false;
|
||||
echoCancellation = true;
|
||||
};
|
||||
volumeBooster.enable = true;
|
||||
webKeybinds.enable = true;
|
||||
webScreenShareFixes.enable = true;
|
||||
whoReacted.enable = true;
|
||||
whosWatching.enable = true;
|
||||
quickReply.enable = true;
|
||||
questCompleter.enable = true;
|
||||
shikiCodeblocks = {
|
||||
enable = true;
|
||||
useDevIcon = "COLOR";
|
||||
theme = "https://raw.githubusercontent.com/shikijs/textmate-grammars-themes/2d87559c7601a928b9f7e0f0dda243d2fb6d4499/packages/tm-themes/themes/kanagawa-wave.json";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.nixcord.config.plugins.PinDMs = {
|
||||
enable = true;
|
||||
canCollapseDmSection = true;
|
||||
userBasedCategoryList = {
|
||||
"1202666382760607774" = [
|
||||
{
|
||||
id = "i9dflmraztc";
|
||||
name = "🏳️⚧️ girlfriends!!! :3 🏳️⚧️";
|
||||
color = 16359423;
|
||||
collapsed = false;
|
||||
channels = [
|
||||
"1436964273162289185"
|
||||
"1436988320474206311"
|
||||
"1449837047383855119"
|
||||
"1436965652861685891"
|
||||
"1436968495190642722"
|
||||
"1465424321919975454"
|
||||
];
|
||||
}
|
||||
{
|
||||
id = "p2v1f5y9zbd";
|
||||
name = "🦋 best frens <3 🦋";
|
||||
color = 10223511;
|
||||
collapsed = false;
|
||||
channels = [
|
||||
"1436985374286155799"
|
||||
"1436965657076826222"
|
||||
"1429921297160212681"
|
||||
"1394808379381387385"
|
||||
"1433593753183977545"
|
||||
"1438254055452446881"
|
||||
"1436966389549236376"
|
||||
"1202678007026819134"
|
||||
"1437151552224624660"
|
||||
"1441906462094921789"
|
||||
"1450340272079769712"
|
||||
"1458123717124165764"
|
||||
"1436975341129306155"
|
||||
"1461885176534794427"
|
||||
"1462155159470866443"
|
||||
"1468735915076878407"
|
||||
];
|
||||
}
|
||||
{
|
||||
id = "c0mg5w635j8";
|
||||
name = "🏳️🌈 close frens x3 🏳️🌈";
|
||||
color = 10780927;
|
||||
collapsed = false;
|
||||
channels = [
|
||||
"1437077103873888290"
|
||||
"1436975346338762823"
|
||||
"1437123353101205590"
|
||||
"1441516692164575283"
|
||||
"1419557866502754334"
|
||||
"1436985041203892315"
|
||||
"1438071327515742229"
|
||||
];
|
||||
}
|
||||
{
|
||||
id = "ghjrq5el3b";
|
||||
name = "frens :3";
|
||||
color = 7334399;
|
||||
collapsed = false;
|
||||
channels = [
|
||||
"1437007154132422701"
|
||||
"1437006448948416526"
|
||||
"1446781617422209068"
|
||||
"1444723474835837103"
|
||||
"1437098569483161721"
|
||||
"1437237573146771469"
|
||||
"1436973705421914123"
|
||||
"1437135359359320125"
|
||||
"1438010723837022343"
|
||||
"1440553969461104740"
|
||||
"1437097082887475201"
|
||||
"1447222320015085740"
|
||||
"1462624704027164824"
|
||||
"1449513783893692589"
|
||||
"1463737720961634461"
|
||||
"1463000874392748249"
|
||||
"1461929299727749145"
|
||||
"1436984534712451105"
|
||||
"1436983282582683813"
|
||||
"1437283420312047659"
|
||||
"1437089201651847315"
|
||||
"1468324280445046824"
|
||||
"1467307140443148288"
|
||||
];
|
||||
}
|
||||
{
|
||||
id = "zbmj00xw7d8";
|
||||
name = "goop chats";
|
||||
color = 14876549;
|
||||
collapsed = false;
|
||||
channels = [
|
||||
"1437132769141719040"
|
||||
"1445549416516681902"
|
||||
"1458849972815663209"
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
26
homes/modules/programs/spicetify.nix
Normal file
26
homes/modules/programs/spicetify.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ inputs, lib, pkgs, ... }:
|
||||
let
|
||||
spicetifyPkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system};
|
||||
in {
|
||||
imports = [ inputs.spicetify-nix.homeManagerModules.default ];
|
||||
programs.spicetify = {
|
||||
enable = true;
|
||||
|
||||
enabledExtensions = with spicetifyPkgs.extensions; [
|
||||
adblock
|
||||
shuffle
|
||||
keyboardShortcut
|
||||
({
|
||||
src = (pkgs.fetchFromGitHub {
|
||||
owner = "Spikerko";
|
||||
repo = "spicy-lyrics";
|
||||
rev = "568c83326aa6aba6ded28c95df6fcfb25cab3648";
|
||||
hash = "sha256-lej93EDzGkmyrg5YMdPSqzrxlIfKsfaDBZosTvxoTNw=";
|
||||
}) + /builds;
|
||||
name = "spicy-lyrics.mjs";
|
||||
})
|
||||
];
|
||||
theme = spicetifyPkgs.themes.comfy;
|
||||
colorScheme = "Sakura";
|
||||
};
|
||||
}
|
||||
86
homes/modules/programs/yazi/yazi.nix
Normal file
86
homes/modules/programs/yazi/yazi.nix
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
{ config, inputs, lib, pkgs, ... }:
|
||||
{
|
||||
# optional dependencies can be found here:
|
||||
# https://yazi-rs.github.io/docs/installation/
|
||||
home.packages = with pkgs; [ # dependencies
|
||||
ripdrag
|
||||
];
|
||||
|
||||
programs.yazi = {
|
||||
enable = true;
|
||||
enableZshIntegration = false; # i mod"if"ied the script in my .zshrc
|
||||
|
||||
settings = {
|
||||
mgr = {
|
||||
show_hidden = true;
|
||||
};
|
||||
log = {
|
||||
enabled = false;
|
||||
};
|
||||
};
|
||||
|
||||
keymap = {
|
||||
mgr.prepend_keymap = [
|
||||
# drag and drop!!
|
||||
{ on = [ "<S-c>" ]; run = ''shell "ripdrag -x -a \"$@\"" --confirm''; }
|
||||
# copy hovered file to clipboard
|
||||
{ on = [ "<S-y>" ]; run = ''shell -- path=%h; echo "file://$path" | wl-copy -t text/uri-list''; }
|
||||
];
|
||||
};
|
||||
|
||||
# they changed it to custom colors, i don't like that, so this is the config
|
||||
# i did like:
|
||||
# https://github.com/sxyazi/yazi/blob/97d0c6bb23df413f4add8b888071233c912c49a3/yazi-config/preset/theme-dark.toml
|
||||
theme = {
|
||||
icon = {
|
||||
dirs = [
|
||||
{ name = ".config"; text = ""; fg = "red"; }
|
||||
{ name = ".git"; text = ""; fg = "blue"; }
|
||||
{ name = ".github"; text = ""; fg = "blue"; }
|
||||
{ name = ".npm"; text = ""; fg = "blue"; }
|
||||
{ name = "Desktop"; text = ""; fg = "magenta"; }
|
||||
{ name = "Documents"; text = ""; fg = "magenta"; }
|
||||
{ name = "Downloads"; text = ""; fg = "red"; }
|
||||
{ name = "Library"; text = ""; fg = "magenta"; }
|
||||
{ name = "Movies"; text = ""; fg = "magenta"; }
|
||||
{ name = "Music"; text = ""; fg = "magenta"; }
|
||||
{ name = "Pictures"; text = ""; fg = "magenta"; }
|
||||
{ name = "Public"; text = ""; fg = "magenta"; }
|
||||
{ name = "Videos"; text = ""; fg = "red"; }
|
||||
];
|
||||
conds = [
|
||||
# special files
|
||||
{ "if" = "orphan"; text = ""; }
|
||||
{ "if" = "link"; text = ""; }
|
||||
{ "if" = "block"; text = ""; }
|
||||
{ "if" = "char"; text = ""; }
|
||||
{ "if" = "fifo"; text = ""; }
|
||||
{ "if" = "sock"; text = ""; }
|
||||
{ "if" = "sticky"; text = ""; }
|
||||
{ "if" = "dummy"; text = ""; }
|
||||
|
||||
# fallback
|
||||
{ "if" = "dir"; text = ""; fg = "blue"; }
|
||||
{ "if" = "exec"; text = ""; }
|
||||
{ "if" = "!dir"; text = ""; }
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# helped me fix it not working:
|
||||
# https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser/issues/56
|
||||
# also, the portal must be enabled in configuration.nix
|
||||
# i can't seem to get it working any other way
|
||||
xdg.configFile."xdg-desktop-portal-termfilechooser/config" = {
|
||||
force = true;
|
||||
text = ''
|
||||
[filechooser]
|
||||
cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
|
||||
default_dir=$HOME
|
||||
env=TERMCMD='kitty --title filechooser'
|
||||
open_mode=suggested
|
||||
save_mode=last
|
||||
'';
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue