From ebf77a5700650947f7ec6d76cadb2decd011b2d1 Mon Sep 17 00:00:00 2001 From: uttarayan21 Date: Wed, 25 Sep 2024 12:47:26 +0530 Subject: [PATCH] feat: Update neovim and other items --- Makefile | 3 + common/nvim.nix | 6 +- darwin/skhd.nix | 5 +- flake.lock | 248 ++++++++++++++++++++++++++++++++++++++++++++-- flake.nix | 4 + neovim/flake.lock | 6 +- neovim/nvim.nix | 239 ++++++++++++++++++++++---------------------- overlays.nix | 1 + 8 files changed, 376 insertions(+), 136 deletions(-) diff --git a/Makefile b/Makefile index 1c98160a..60bd1fdd 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,9 @@ default: just just: just +local: + just local + darwin: nix run nix-darwin -- switch --flake . --show-trace build_darwin: diff --git a/common/nvim.nix b/common/nvim.nix index 7fb9f599..155b7d60 100644 --- a/common/nvim.nix +++ b/common/nvim.nix @@ -4,5 +4,9 @@ ... }: { imports = [inputs.nixvim.homeManagerModules.nixvim]; - programs.nixvim = pkgs.sneovim.config // {enable = true;}; + programs.nixvim = + pkgs.sneovim.config + // { + enable = true; + }; } diff --git a/darwin/skhd.nix b/darwin/skhd.nix index 5a705fa9..7bb06d86 100644 --- a/darwin/skhd.nix +++ b/darwin/skhd.nix @@ -3,10 +3,9 @@ skhd = { enable = true; skhdConfig = '' - # open terminal, blazingly fast compared to iTerm/Hyper - alt - return : open -na Kitty.app + alt - return : ${pkgs.lib.getExe pkgs.kitty} -1 --directory ~ # alt - return : $\{pkgs.wezterm}/bin/wezterm-gui - shift + alt - return: pkill mpv + shift + alt - return: pkill afplay # open mpv alt - m : open -na /Applications/mpv.app $(pbpaste) diff --git a/flake.lock b/flake.lock index b6a5dc6a..a23afec1 100644 --- a/flake.lock +++ b/flake.lock @@ -399,6 +399,22 @@ "type": "github" } }, + "flake-compat_10": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-compat_2": { "flake": false, "locked": { @@ -507,6 +523,22 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, + "flake-compat_9": { + "flake": false, + "locked": { + "lastModified": 1641205782, + "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -717,11 +749,11 @@ "systems": "systems_12" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -731,6 +763,36 @@ } }, "flake-utils_12": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_13": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_14": { "inputs": { "systems": "systems_13" }, @@ -748,7 +810,7 @@ "type": "github" } }, - "flake-utils_13": { + "flake-utils_15": { "inputs": { "systems": "systems_14" }, @@ -766,6 +828,24 @@ "type": "github" } }, + "flake-utils_16": { + "inputs": { + "systems": "systems_15" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flake-utils_2": { "inputs": { "systems": "systems_2" @@ -1635,6 +1715,22 @@ "type": "github" } }, + "neorg-telescope_3": { + "flake": false, + "locked": { + "lastModified": 1722358034, + "narHash": "sha256-ei4uUqpIQjGKzu5ryu0Hlmis9TS9FJsYnjt4J4QdWlw=", + "owner": "nvim-neorg", + "repo": "neorg-telescope", + "rev": "ddb2556644cae922699a239bbb0fe16e25b084b7", + "type": "github" + }, + "original": { + "owner": "nvim-neorg", + "repo": "neorg-telescope", + "type": "github" + } + }, "neorg_2": { "flake": false, "locked": { @@ -1651,6 +1747,22 @@ "type": "github" } }, + "neorg_3": { + "flake": false, + "locked": { + "lastModified": 1725804232, + "narHash": "sha256-IOhb06MIC8LLPpa1XnZ7TRqKWUabHeBa3X2p9Y/bT4s=", + "owner": "nvim-neorg", + "repo": "neorg", + "rev": "ba35900b21921c439e676b063a79c8fad914eac9", + "type": "github" + }, + "original": { + "owner": "nvim-neorg", + "repo": "neorg", + "type": "github" + } + }, "neovim": { "inputs": { "d2": "d2", @@ -1675,7 +1787,7 @@ }, "locked": { "lastModified": 1, - "narHash": "sha256-1KRrOGbEiV6HdbR+qTY7XZQYYErPfh/4iHqC64s9OXI=", + "narHash": "sha256-5p5wFrOAxy6Q3YX8uSKoMgw3682VuRv+6C79C+wyTUg=", "path": "./neovim", "type": "path" }, @@ -1919,6 +2031,22 @@ "type": "github" } }, + "nixpkgs_10": { + "locked": { + "lastModified": 1644486793, + "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1706487304, @@ -2026,6 +2154,22 @@ "type": "github" } }, + "nixpkgs_9": { + "locked": { + "lastModified": 1644486793, + "narHash": "sha256-EeijR4guVHgVv+JpOX3cQO+1XdrkJfGmiJ9XVsVU530=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1882c6b7368fd284ad01b0a5b5601ef136321292", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixvim": { "inputs": { "devshell": "devshell", @@ -2122,11 +2266,36 @@ "norg-meta": "norg-meta" }, "locked": { - "lastModified": 1726561227, - "narHash": "sha256-rrE6YH5jpEzwLcTk9BeNNBhMVg9j7y4X8/4DTysIKWY=", + "lastModified": 1726621796, + "narHash": "sha256-LVrXwElj1mYcHTZADzIB0eoXon+kDFkeTkeC3f7IIbY=", "owner": "nvim-neorg", "repo": "nixpkgs-neorg-overlay", - "rev": "fd8139aca9b75b00eb5ad94923c39ea61e75dbb4", + "rev": "1f0b123a6b1e4d670e5e7ab5acfc32333846377c", + "type": "github" + }, + "original": { + "owner": "nvim-neorg", + "repo": "nixpkgs-neorg-overlay", + "type": "github" + } + }, + "nno_2": { + "inputs": { + "flake-utils": "flake-utils_11", + "neorg": "neorg_3", + "neorg-telescope": "neorg-telescope_3", + "nixpkgs": [ + "nixpkgs" + ], + "norg": "norg_2", + "norg-meta": "norg-meta_2" + }, + "locked": { + "lastModified": 1726621796, + "narHash": "sha256-LVrXwElj1mYcHTZADzIB0eoXon+kDFkeTkeC3f7IIbY=", + "owner": "nvim-neorg", + "repo": "nixpkgs-neorg-overlay", + "rev": "1f0b123a6b1e4d670e5e7ab5acfc32333846377c", "type": "github" }, "original": { @@ -2176,6 +2345,47 @@ "type": "github" } }, + "norg-meta_2": { + "inputs": { + "flake-compat": "flake-compat_10", + "flake-utils": "flake-utils_13", + "nixpkgs": "nixpkgs_10" + }, + "locked": { + "lastModified": 1713028366, + "narHash": "sha256-8qSdwHlfnjFuQF4zNdLtU2/tzDRhDZbo9K54Xxgn5+8=", + "owner": "nvim-neorg", + "repo": "tree-sitter-norg-meta", + "rev": "6f0510cc516a3af3396a682fbd6655486c2c9d2d", + "type": "github" + }, + "original": { + "owner": "nvim-neorg", + "repo": "tree-sitter-norg-meta", + "type": "github" + } + }, + "norg_2": { + "inputs": { + "flake-compat": "flake-compat_9", + "flake-utils": "flake-utils_12", + "nixpkgs": "nixpkgs_9" + }, + "locked": { + "lastModified": 1672582520, + "narHash": "sha256-kv3UiJUqMSF1qd3r4OCWomVTHTYjwX/EBRWm8mOSdwg=", + "owner": "nvim-neorg", + "repo": "tree-sitter-norg", + "rev": "d7a466e182a532065a559dbfc7a847271d5e9c29", + "type": "github" + }, + "original": { + "owner": "nvim-neorg", + "ref": "dev", + "repo": "tree-sitter-norg", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1726569072, @@ -2254,7 +2464,7 @@ }, "onepassword-shell-plugins": { "inputs": { - "flake-utils": "flake-utils_11", + "flake-utils": "flake-utils_14", "nixpkgs": [ "nixpkgs" ] @@ -2369,6 +2579,7 @@ "nixpkgs": "nixpkgs_8", "nixpkgs-master": "nixpkgs-master", "nixvim": "nixvim_2", + "nno": "nno_2", "nur": "nur", "onepassword-shell-plugins": "onepassword-shell-plugins", "openapi-tui": "openapi-tui", @@ -2528,7 +2739,7 @@ "subflakes": { "inputs": { "csshacks": "csshacks", - "flake-utils": "flake-utils_12", + "flake-utils": "flake-utils_15", "nixpkgs": [ "nixpkgs" ] @@ -2634,6 +2845,21 @@ "type": "github" } }, + "systems_15": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "systems_2": { "locked": { "lastModified": 1681028828, @@ -2884,7 +3110,7 @@ "zjstatus": { "inputs": { "crane": "crane_4", - "flake-utils": "flake-utils_13", + "flake-utils": "flake-utils_16", "nixpkgs": [ "nixpkgs" ], diff --git a/flake.nix b/flake.nix index e186bd17..7ed60910 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,10 @@ url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; + nno = { + url = "github:nvim-neorg/nixpkgs-neorg-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; anyrun = { # My fork of anyrun that allows up / down with / url = "github:uttarayan21/anyrun"; diff --git a/neovim/flake.lock b/neovim/flake.lock index 5e2ee946..325bc268 100644 --- a/neovim/flake.lock +++ b/neovim/flake.lock @@ -668,11 +668,11 @@ "norg-meta": "norg-meta" }, "locked": { - "lastModified": 1726561227, - "narHash": "sha256-rrE6YH5jpEzwLcTk9BeNNBhMVg9j7y4X8/4DTysIKWY=", + "lastModified": 1726621796, + "narHash": "sha256-LVrXwElj1mYcHTZADzIB0eoXon+kDFkeTkeC3f7IIbY=", "owner": "nvim-neorg", "repo": "nixpkgs-neorg-overlay", - "rev": "fd8139aca9b75b00eb5ad94923c39ea61e75dbb4", + "rev": "1f0b123a6b1e4d670e5e7ab5acfc32333846377c", "type": "github" }, "original": { diff --git a/neovim/nvim.nix b/neovim/nvim.nix index 7ed79f5e..6e296d1a 100644 --- a/neovim/nvim.nix +++ b/neovim/nvim.nix @@ -94,7 +94,7 @@ in rec { enable = true; settings = { adapters = [ - # ''require('rustaceanvim.neotest')'' + ''require('rustaceanvim.neotest')'' ]; }; }; @@ -125,6 +125,11 @@ in rec { config.install_parsers = false; config.configure_parsers = false; }; + + "core.integrations.image" = { + config.tmux_show_only_in_active_window = true; + }; + "core.dirman" = { config = { default_workspace = "Notes"; @@ -157,7 +162,6 @@ in rec { markdown-preview = { enable = true; - settings.auto_start = false; }; noice = { @@ -179,7 +183,13 @@ in rec { treesitter = { enable = true; - settings.indent.enable = true; + settings = { + indent.enable = true; + highlight = { + enable = true; + additional_vim_regex_highlighting = true; + }; + }; folding = true; grammarPackages = (with pkgs.tree-sitter-grammars; [ @@ -244,16 +254,23 @@ in rec { ''; }; rustaceanvim = { - enable = false; + enable = true; settings = { server = { default_settings = { rust-analyzer = { + inlayHints = { + genericParameterHints = { + lifetime.enable = true; + }; + # implicitDrops.enable = true; + }; files = { excludeDirs = [ ".cargo" ".direnv" ".git" + ".vcpkg" "node_modules" "target" ]; @@ -265,14 +282,30 @@ in rec { checkOnSave = true; check = { - command = "clippy"; + command = "check"; features = "all"; }; }; }; }; - dap = { + dap = let + vscode-lldb = pkgs.vscode-extensions.vadimcn.vscode-lldb; + liblldb = + if pkgs.stdenv.isLinux + then "${vscode-lldb.lldb}/lib/liblldb.so" + else if pkgs.stdenv.isDarwin + then "${vscode-lldb.lldb}/lib/liblldb.dylib" + else null; + codelldb = "${vscode-lldb.adapter}/bin/codelldb"; + in { autoload_configurations = false; + adapter = + /* + lua + */ + '' + require('rustaceanvim.config').get_codelldb_adapter("${codelldb}", "${liblldb}") + ''; }; tools = { float_win_config = {border = "rounded";}; @@ -298,24 +331,34 @@ in rec { lua-ls.enable = true; jsonls.enable = true; html.enable = true; + htmx.enable = true; + elixirls.enable = true; ast-grep.enable = true; + sqls.enable = true; + pyright.enable = true; # pylyzer.enable = true; - rust-analyzer = { - enable = true; - installCargo = false; - installRustc = false; - settings = { - files = { - excludeDirs = [ - ".cargo" - ".direnv" - ".git" - "node_modules" - "target" - ]; - }; - }; - }; + # rust-analyzer = { + # enable = false; + # installCargo = false; + # installRustc = false; + # settings = { + # inlayHints = { + # genericParameterHints = { + # lifetime.enable = true; + # }; + # implicitDrops.enable = true; + # }; + # files = { + # excludeDirs = [ + # ".cargo" + # ".direnv" + # ".git" + # "node_modules" + # "target" + # ]; + # }; + # }; + # }; }; onAttach = /* @@ -451,11 +494,11 @@ in rec { }; autoCmd = [ - # { - # event = ["BufEnter" "BufWinEnter"]; - # pattern = "*.norg"; - # command = "set conceallevel=3"; - # } + { + event = ["BufEnter" "BufWinEnter"]; + pattern = "*.norg"; + command = "set conceallevel=3"; + } { event = ["BufWinLeave"]; pattern = "?*"; @@ -468,15 +511,7 @@ in rec { } ]; - extraConfigLua = let - codelldb = pkgs.vscode-extensions.vadimcn.vscode-lldb.adapter; - liblldb = - if pkgs.stdenv.isLinux - then "${codelldb}/lldb/lib/liblldb.so" - else if pkgs.stdenv.isDarwin - then "${codelldb}/lldb/lib/liblldb.dylib" - else null; - in + extraConfigLua = /* lua */ @@ -529,25 +564,20 @@ in rec { default_merge_method = "squash"; }) - local rr_dap = require('nvim-dap-rr') - rr_dap.setup({ - mappings = { - continue = "" - }, - }) + -- local rr_dap = require('nvim-dap-rr') + -- rr_dap.setup({ + -- mappings = { + -- continue = "" + -- }, + -- }) - local dap = require'dap'; + -- local dap = require'dap'; -- dap.configurations.rust = { rr_dap.get_rust_config() } - dap.configurations.cpp = { rr_dap.get_config() } + -- dap.configurations.cpp = { rr_dap.get_config() } if not vim.g.neovide then require('neoscroll').setup() require('image').setup({["backend"] = "kitty",["tmux_show_only_in_active_window"] = true}) - -- load["core.integrations.image"] = { - -- config = { - -- tmux_show_only_in_active_window = true, - -- } - -- } else vim.o.guifont = "Hasklug Nerd Font Mono:h13" vim.g.neovide_cursor_vfx_mode = "railgun" @@ -556,20 +586,20 @@ in rec { require('lspconfig.ui.windows').default_options.border = 'single' catcher(require('nvim_context_vt').setup) - catcher(function() - require('nvim-devdocs').setup({ - ensure_installed = {"nix", "rust"}, - float_win = { - relative = "editor", - height = 80, - width = 100, - border = "rounded", - }, - after_open = function() - vim.o.conceallevel = 3 - end, - }) - end) + -- catcher(function() + -- require('nvim-devdocs').setup({ + -- ensure_installed = {"nix", "rust"}, + -- float_win = { + -- relative = "editor", + -- height = 80, + -- width = 100, + -- border = "rounded", + -- }, + -- after_open = function() + -- vim.o.conceallevel = 3 + -- end, + -- }) + -- end) vim.api.nvim_create_user_command('Reso', function() @@ -655,75 +685,48 @@ in rec { # package = pkgs.neovim-unwrapped; # pkgs.neovim; opts = { - shell = "sh"; - number = true; - relativenumber = true; - tabstop = 4; - softtabstop = 4; - shiftwidth = 4; - expandtab = true; - hidden = true; - smartcase = true; - termguicolors = true; - signcolumn = "yes"; - wrap = true; completeopt = "menu,menuone,popup,noselect"; - # undodir = "${config.xdg.cacheHome}/undodir"; - undofile = true; - viewoptions = "cursor,folds"; - # concealcursor = "n"; + expandtab = true; foldenable = true; foldlevel = 99; foldlevelstart = 99; + hidden = true; + number = true; + relativenumber = true; + shell = "sh"; + shiftwidth = 4; + signcolumn = "yes"; + smartcase = true; + softtabstop = 4; + tabstop = 4; + termguicolors = true; + undofile = true; + viewoptions = "cursor,folds"; + wrap = true; }; extraPlugins = with pkgs.vimPlugins; [ - # Wut - image-nvim - - # UI and UX - vim-abolish - octo-nvim - neoscroll-nvim - - # Debuggging - nvim-dap-rr - - # Treesitter stuff - outline-nvim - - # lsp stuff + FTerm-nvim copilot-lua crates-nvim - luasnip - - # UI - nvim-web-devicons - - # Utils - FTerm-nvim - plenary-nvim - vim-speeddating - - # Testing - # neotest - - # Helper libs - webapi-vim - - # Treesitter - nvim_context_vt - nvim-devdocs - - # navigator - - iron-nvim d2 - + image-nvim + iron-nvim + luasnip + neoscroll-nvim + nvim-web-devicons + nvim_context_vt + octo-nvim + outline-nvim + plenary-nvim + vim-abolish + vim-speeddating + webapi-vim pkgs.tree-sitter-grammars.tree-sitter-just pkgs.tree-sitter-grammars.tree-sitter-nu pkgs.tree-sitter-grammars.tree-sitter-norg pkgs.tree-sitter-grammars.tree-sitter-norg-meta ]; extraLuaPackages = luaPkgs: with luaPkgs; [lua-utils-nvim nvim-nio pathlib-nvim]; + extraPackages = [pkgs.lldb]; }; } diff --git a/overlays.nix b/overlays.nix index e78c348d..d8f339eb 100644 --- a/overlays.nix +++ b/overlays.nix @@ -270,6 +270,7 @@ in [ inputs.nixvim.overlays.default inputs.nur.overlay inputs.neovim.overlays.default + inputs.nno.overlays.default # catppuccin inputs.rust-overlay.overlays.default # inputs.hyprland.overlays.default