diff --git a/config/nvim/init.lua b/config/nvim/init.lua index 5d1821f..3270e18 100644 --- a/config/nvim/init.lua +++ b/config/nvim/init.lua @@ -161,8 +161,12 @@ require("lazy").setup({ opts = { library = { -- Load luvit types when the `vim.uv` word is found - { path = "luvit-meta/library", words = { "vim%.uv" } }, + { path = "luvit-meta/library", words = { "vim%.uv" } }, { path = "nvim-lua/plenary.nvim" }, + { path = "saghen/blink.cmp" }, + { path = "MeanderingProgrammer/render-markdown.nvim" }, + { path = "folke/snacks.nvim" }, + { path = "folke/which-key.nvim" }, }, }, }, diff --git a/config/nvim/lua/custom/plugins/lsp.lua b/config/nvim/lua/custom/plugins/lsp.lua index ee0cefe..e5d56b5 100644 --- a/config/nvim/lua/custom/plugins/lsp.lua +++ b/config/nvim/lua/custom/plugins/lsp.lua @@ -32,6 +32,14 @@ return { completion = { callSnippet = "Replace", }, + diagnostics = { + globals = { "vim" }, + }, + format = { + enable = true, + indent_style = "space", + indent_size = 2, + }, }, }, }, diff --git a/config/nvim/lua/custom/plugins/lualine.lua b/config/nvim/lua/custom/plugins/lualine.lua index 24910c9..7743323 100644 --- a/config/nvim/lua/custom/plugins/lualine.lua +++ b/config/nvim/lua/custom/plugins/lualine.lua @@ -1,246 +1,214 @@ return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - -- Eviline config for lualine - -- Author: shadmansaleh - -- Credit: glepnir - local lualine = require("lualine") - - -- Color table for highlights - -- stylua: ignore - local colors = { - bg = '#202328', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', - } - - local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand("%:p:h") - local gitdir = vim.fn.finddir(".git", filepath .. ";") - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, - } - - -- Config - local config = { - options = { - -- Disable sections and component separators - component_separators = "", - section_separators = "", - theme = { - -- We are going to use lualine_c an lualine_x as left and - -- right section. Both are highlighted by c theme . So we - -- are just setting default looks o statusline - normal = { c = { fg = colors.fg, bg = colors.bg } }, - inactive = { c = { fg = colors.fg, bg = colors.bg } }, - }, - }, - sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - -- These will be filled later - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - -- these are to remove the defaults - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, - } - - -- Inserts a component in lualine_c at left section - local function ins_left(component) - table.insert(config.sections.lualine_c, component) - end - - -- Inserts a component in lualine_x at right section - local function ins_right(component) - table.insert(config.sections.lualine_x, component) - end - - ins_left({ - function() - return "▊" - end, - color = { fg = colors.blue }, -- Sets highlighting of component - padding = { left = 0, right = 1 }, -- We don't need space before this - }) - - ins_left({ - -- mode component - function() - return "" - end, - color = function() - -- auto change color according to neovims mode - local mode_color = { - n = colors.red, - i = colors.green, - v = colors.blue, - [""] = colors.blue, - V = colors.blue, - c = colors.magenta, - no = colors.red, - s = colors.orange, - S = colors.orange, - [""] = colors.orange, - ic = colors.yellow, - R = colors.violet, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ["r?"] = colors.cyan, - ["!"] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, - }) - - ins_left({ - -- filesize component - "filesize", - cond = conditions.buffer_not_empty, - }) - - ins_left({ - "filename", - cond = conditions.buffer_not_empty, - color = { fg = colors.magenta, gui = "bold" }, - path = 4, - }) - - ins_left({ "location" }) - - ins_left({ "progress", color = { fg = colors.fg, gui = "bold" } }) - - ins_left({ - "diagnostics", - sources = { "nvim_diagnostic" }, - symbols = { error = " ", warn = " ", info = " " }, - diagnostics_color = { - error = { fg = colors.red }, - warn = { fg = colors.yellow }, - info = { fg = colors.cyan }, - }, - }) - - -- Insert mid section. You can make any number of sections in neovim :) - -- for lualine it's any number greater then 2 - ins_left({ - function() - return "%=" - end, - }) - - ins_left({ - "filetype", - colored = true, -- Displays filetype icon in color if set to true - icons_enabled = false, -- { align = 'right' }, - }) - - ins_left({ - -- Lsp server name . - function() - local msg = "No Active Lsp" - local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) - local clients = vim.lsp.get_clients() - if next(clients) == nil then - return msg - end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg - end, - icon = " ", - color = { fg = "#ffffff", gui = "bold" }, - }) - - -- Add components to right sections - -- ins_right { - -- 'o:encoding', -- option component same as &encoding in viml - -- fmt = string.upper, -- I'm not sure why it's upper case either ;) - -- cond = conditions.hide_in_width, - -- color = { fg = colors.green, gui = 'bold' }, - -- } - - -- ins_right { - -- 'fileformat', - -- fmt = string.upper, - -- icons_enabled = false, -- I think icons are cool but Eviline doesn't have them. sigh - -- color = { fg = colors.green, gui = 'bold' }, - -- } - - -- local function jujutsu() - -- local handle = - -- io.popen('jj log --no-graph -r "@" -T \'change_id.shortest() ++ " " ++ description.first_line()\'') - -- if handle == nil then - -- return "" - -- end - -- - -- local result = handle:read("*a") - -- handle:close() - -- return result - -- end - -- - ins_right({ - "branch", - icon = "", - color = { fg = colors.violet, gui = "bold" }, - }) - - ins_right({ - "diff", - -- Is it me or the symbol for modified us really weird - symbols = { added = " ", modified = "󰝤 ", removed = " " }, - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - cond = conditions.hide_in_width, - }) - - ins_right({ - function() - return "▊" - end, - color = { fg = colors.blue }, - padding = { left = 1 }, - }) - - -- Now don't forget to initialize lualine - lualine.setup(config) - end, + "nvim-lualine/lualine.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = function() + -- Eviline config for lualine + -- Author: shadmansaleh + -- Credit: glepnir + local lualine = require("lualine") + + -- Color table for highlights + -- stylua: ignore + local colors = { + bg = '#202328', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', + } + + local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand("%:t")) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand("%:p:h") + local gitdir = vim.fn.finddir(".git", filepath .. ";") + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, + } + + -- Config + local config = { + options = { + -- Disable sections and component separators + component_separators = "", + section_separators = "", + theme = { + -- We are going to use lualine_c an lualine_x as left and + -- right section. Both are highlighted by c theme . So we + -- are just setting default looks o statusline + normal = { c = { fg = colors.fg, bg = colors.bg } }, + inactive = { c = { fg = colors.fg, bg = colors.bg } }, + }, + }, + sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + -- These will be filled later + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + -- these are to remove the defaults + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + } + + -- Inserts a component in lualine_c at left section + local function ins_left(component) + table.insert(config.sections.lualine_c, component) + end + + -- Inserts a component in lualine_x at right section + local function ins_right(component) + table.insert(config.sections.lualine_x, component) + end + + ins_left({ + function() + return "▊" + end, + color = { fg = colors.blue }, -- Sets highlighting of component + padding = { left = 0, right = 1 }, -- We don't need space before this + }) + + ins_left({ + -- mode component + function() + return "" + end, + color = function() + -- auto change color according to neovims mode + local mode_color = { + n = colors.red, + i = colors.green, + v = colors.blue, + [""] = colors.blue, + V = colors.blue, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + [""] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ["r?"] = colors.cyan, + ["!"] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, + }) + + ins_left({ + -- filesize component + "filesize", + cond = conditions.buffer_not_empty, + }) + + ins_left({ + "filename", + cond = conditions.buffer_not_empty, + color = { fg = colors.magenta, gui = "bold" }, + path = 4, + }) + + ins_left({ "location" }) + + ins_left({ "progress", color = { fg = colors.fg, gui = "bold" } }) + + ins_left({ + "diagnostics", + sources = { "nvim_diagnostic" }, + symbols = { error = " ", warn = " ", info = " " }, + diagnostics_color = { + error = { fg = colors.red }, + warn = { fg = colors.yellow }, + info = { fg = colors.cyan }, + }, + }) + + -- Insert mid section. You can make any number of sections in neovim :) + -- for lualine it's any number greater then 2 + ins_left({ + function() + return "%=" + end, + }) + + ins_left({ + "filetype", + colored = true, -- Displays filetype icon in color if set to true + icons_enabled = false, -- { align = 'right' }, + }) + + ins_left({ + -- Lsp server name . + function() + local msg = "No Active Lsp" + local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) + local clients = vim.lsp.get_clients() + if next(clients) == nil then + return msg + end + for _, client in ipairs(clients) do + ---@type string[]|nil + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return client.name + end + end + return msg + end, + icon = " ", + color = { fg = "#ffffff", gui = "bold" }, + }) + + ins_right({ + "diff", + -- Is it me or the symbol for modified us really weird + symbols = { added = " ", modified = "󰝤 ", removed = " " }, + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + cond = conditions.hide_in_width, + }) + + ins_right({ + function() + return "▊" + end, + color = { fg = colors.blue }, + padding = { left = 1 }, + }) + + -- Now don't forget to initialize lualine + lualine.setup(config) + end, } diff --git a/config/nvim/lua/custom/plugins/vscpanel.lua b/config/nvim/lua/custom/plugins/vscpanel.lua index 27cf7ec..fbc0621 100644 --- a/config/nvim/lua/custom/plugins/vscpanel.lua +++ b/config/nvim/lua/custom/plugins/vscpanel.lua @@ -1,8 +1,13 @@ return { -- dir = "~/workspace/mpriscella/vscpanel.nvim", - -- name = "vscpanel.nvim", 'mpriscella/vscpanel.nvim', + name = "vscpanel.nvim", lazy = false, + opts = { + problems = { + scope = "current_file" + } + }, config = function() vim.keymap.set("t", "", "", { desc = "Move focus to the left window" }) vim.keymap.set("t", "", "", { desc = "Move focus to the right window" }) diff --git a/flake.lock b/flake.lock index 9464df5..7648874 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1767702900, - "narHash": "sha256-xMzHmNytl7JgFRov2jHf2GYsLVp/sAfYO0JvbZt0uDo=", + "lastModified": 1769699427, + "narHash": "sha256-dAQt3qXugGhg92A+jqaUcmH0elbgEN/mV4vy1+ohLZk=", "owner": "nix-community", "repo": "home-manager", - "rev": "38e187fd2f9efac197e03be0c25f3ee215974144", + "rev": "2a08ab21abc8b482f41c521b5f9b0df5b18a67eb", "type": "github" }, "original": { @@ -27,11 +27,11 @@ ] }, "locked": { - "lastModified": 1767028240, - "narHash": "sha256-0/fLUqwJ4Z774muguUyn5t8AQ6wyxlNbHexpje+5hRo=", + "lastModified": 1768764703, + "narHash": "sha256-5ulSDyOG1U+1sJhkJHYsUOWEsmtLl97O0NTVMvgIVyc=", "owner": "nix-darwin", "repo": "nix-darwin", - "rev": "c31afa6e76da9bbc7c9295e39c7de9fca1071ea1", + "rev": "0fc4e7ac670a0ed874abacf73c4b072a6a58064b", "type": "github" }, "original": { @@ -42,11 +42,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1767364772, - "narHash": "sha256-fFUnEYMla8b7UKjijLnMe+oVFOz6HjijGGNS1l7dYaQ=", + "lastModified": 1769527094, + "narHash": "sha256-xV20Alb7ZGN7qujnsi5lG1NckSUmpIb05H2Xar73TDc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "16c7794d0a28b5a37904d55bcca36003b9109aaa", + "rev": "afce96367b2e37fc29afb5543573cd49db3357b7", "type": "github" }, "original": { @@ -71,11 +71,11 @@ ] }, "locked": { - "lastModified": 1767826491, - "narHash": "sha256-WSBENPotD2MIhZwolL6GC9npqgaS5fkM7j07V2i/Ur8=", + "lastModified": 1769469829, + "narHash": "sha256-wFcr32ZqspCxk4+FvIxIL0AZktRs6DuF8oOsLt59YBU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "ea3adcb6d2a000d9a69d0e23cad1f2cacb3a9fbe", + "rev": "c5eebd4eb2e3372fe12a8d70a248a6ee9dd02eff", "type": "github" }, "original": { diff --git a/home-manager/home.nix b/home-manager/home.nix index 4d5decd..1e4c821 100644 --- a/home-manager/home.nix +++ b/home-manager/home.nix @@ -18,6 +18,7 @@ ./programs/gpg.nix ./programs/jujutsu.nix ./programs/k9s.nix + ./programs/mcp.nix ./programs/sops.nix ./programs/starship.nix ./programs/tmux.nix diff --git a/home-manager/programs/claude-code.nix b/home-manager/programs/claude-code.nix index 585a0d4..0f41ad4 100644 --- a/home-manager/programs/claude-code.nix +++ b/home-manager/programs/claude-code.nix @@ -3,14 +3,6 @@ programs.claude-code = { enable = true; - mcpServers = { - github = { - type = "http"; - url = "https://api.githubcopilot.com/mcp/"; - headers = { - Authorization = "Bearer \${GITHUB_MCP_TOKEN}"; - }; - }; - }; + enableMcpIntegration = true; }; } diff --git a/home-manager/programs/jujutsu.nix b/home-manager/programs/jujutsu.nix index dfec1b8..46439de 100644 --- a/home-manager/programs/jujutsu.nix +++ b/home-manager/programs/jujutsu.nix @@ -10,10 +10,8 @@ settings = lib.mkMerge [ { git = { - auto-local-bookmark = true; - fetch = { - bookmark = ["main" "master"]; - }; + auto-track-bookmarks = "main"; + fetch-tags = true; }; template-aliases = { "format_timestamp(timestamp)" = "timestamp.ago()"; diff --git a/home-manager/programs/mcp.nix b/home-manager/programs/mcp.nix new file mode 100644 index 0000000..ef95239 --- /dev/null +++ b/home-manager/programs/mcp.nix @@ -0,0 +1,16 @@ +# https://github.com/nix-community/home-manager/blob/master/modules/programs/mcp.nix +{...}: { + programs.mcp = { + enable = true; + + servers = { + github = { + type = "http"; + url = "https://api.githubcopilot.com/mcp"; + headers = { + Authorization = "Bearer \${GITHUB_MCP_TOKEN}"; + }; + }; + }; + }; +} diff --git a/home-manager/programs/sops.nix b/home-manager/programs/sops.nix index 83e2ae3..b5cda31 100644 --- a/home-manager/programs/sops.nix +++ b/home-manager/programs/sops.nix @@ -15,6 +15,11 @@ in { defaultSopsFile = ../../secrets/secrets.yaml; + # macOS launchd service needs PATH for getconf, newfs_hfs, etc. + environment = lib.mkIf isDarwin { + PATH = lib.mkForce "/usr/bin:/bin:/usr/sbin:/sbin"; + }; + secrets = { github_mcp_token = {}; }; diff --git a/nix-darwin/base.nix b/nix-darwin/base.nix index d6732a2..78fe581 100644 --- a/nix-darwin/base.nix +++ b/nix-darwin/base.nix @@ -32,6 +32,10 @@ upgrade = true; }; + brews = [ + "localstack/tap/localstack-cli" + ]; + casks = [ "devtoys" "headlamp"