From d0011ce867dc2a2e47f411952cd97b3beecde73b Mon Sep 17 00:00:00 2001 From: Mykhailo Nikiforov Date: Thu, 23 Oct 2025 19:50:10 +0300 Subject: [PATCH] feat: nixvim configuration init --- .gitea/workflows/build-flake.yml | 2 +- .gitingore => .gitignore | 0 config/default.nix | 38 +- config/modules/colorschemes/catppuccin.nix | 14 + config/modules/plugins/blink-cmp.nix | 3 + config/modules/plugins/bufferline.nix | 46 ++ config/modules/plugins/conform-nvim.nix | 3 + config/modules/plugins/fzf-lua.nix | 30 ++ config/modules/plugins/gitsigns.nix | 9 + config/modules/plugins/lazygit.nix | 3 + config/modules/plugins/lsp/ansiblels.nix | 3 + config/modules/plugins/lsp/bashls.nix | 3 + config/modules/plugins/lsp/default.nix | 75 +++ .../lsp/docker_compose_language_server.nix | 3 + config/modules/plugins/lsp/dockerls.nix | 3 + config/modules/plugins/lsp/gopls.nix | 3 + config/modules/plugins/lsp/helm_ls.nix | 3 + config/modules/plugins/lsp/jdtls.nix | 3 + config/modules/plugins/lsp/jsonls.nix | 3 + config/modules/plugins/lsp/jsonnet_ls.nix | 3 + config/modules/plugins/lsp/just.nix | 3 + config/modules/plugins/lsp/lspconfig.nix | 3 + config/modules/plugins/lsp/lua_ls.nix | 3 + config/modules/plugins/lsp/marksman.nix | 3 + config/modules/plugins/lsp/nixd.nix | 3 + config/modules/plugins/lsp/ruff.nix | 3 + config/modules/plugins/lsp/tflint.nix | 3 + config/modules/plugins/lsp/yamlls.nix | 3 + config/modules/plugins/mini.nix | 11 + config/modules/plugins/neotree.nix | 32 ++ config/modules/plugins/oil.nix | 14 + config/modules/plugins/snacks.nix | 491 ++++++++++++++++++ config/modules/plugins/tmux-navigator.nix | 3 + config/modules/plugins/treesitter.nix | 35 ++ config/modules/plugins/undotree.nix | 14 + config/modules/plugins/which-key.nix | 5 + config/options.nix | 115 ++++ config/src/lazygit/config.yml | 1 - config/src/lazygit/state.yml | 1 - config/src/nvim/.neoconf.json | 15 - config/src/nvim/init.lua | 8 - config/src/nvim/lazy-lock.json | 1 - config/src/nvim/lazyvim.json | 1 - config/src/nvim/lua/config/autocmds.lua | 3 - config/src/nvim/lua/config/keymaps.lua | 3 - config/src/nvim/lua/config/lazy.lua | 60 --- config/src/nvim/lua/config/options.lua | 7 - config/src/nvim/lua/plugins/catppuccin.lua | 62 --- config/src/nvim/lua/plugins/lang/nix.lua | 41 -- config/src/nvim/lua/plugins/lang/shell.lua | 47 -- config/src/nvim/lua/plugins/misc/bigfile.lua | 9 - .../nvim/lua/plugins/misc/tmux-navigator.lua | 17 - config/src/nvim/lua/plugins/telescope.lua | 31 -- config/src/nvim/lua/plugins/tokyonight.lua | 10 - config/src/nvim/lua/plugins/ui/colorizer.lua | 6 - config/src/nvim/lua/plugins/undotree.lua | 6 - config/src/nvim/stylua.toml | 3 - flake.lock | 289 +++++------ flake.nix | 94 ++-- packages/lazyVim.nix | 13 - renovate.json5 | 7 - runtimeDeps.nix | 34 -- 62 files changed, 1150 insertions(+), 613 deletions(-) rename .gitingore => .gitignore (100%) create mode 100644 config/modules/colorschemes/catppuccin.nix create mode 100644 config/modules/plugins/blink-cmp.nix create mode 100644 config/modules/plugins/bufferline.nix create mode 100644 config/modules/plugins/conform-nvim.nix create mode 100644 config/modules/plugins/fzf-lua.nix create mode 100644 config/modules/plugins/gitsigns.nix create mode 100644 config/modules/plugins/lazygit.nix create mode 100644 config/modules/plugins/lsp/ansiblels.nix create mode 100644 config/modules/plugins/lsp/bashls.nix create mode 100644 config/modules/plugins/lsp/default.nix create mode 100644 config/modules/plugins/lsp/docker_compose_language_server.nix create mode 100644 config/modules/plugins/lsp/dockerls.nix create mode 100644 config/modules/plugins/lsp/gopls.nix create mode 100644 config/modules/plugins/lsp/helm_ls.nix create mode 100644 config/modules/plugins/lsp/jdtls.nix create mode 100644 config/modules/plugins/lsp/jsonls.nix create mode 100644 config/modules/plugins/lsp/jsonnet_ls.nix create mode 100644 config/modules/plugins/lsp/just.nix create mode 100644 config/modules/plugins/lsp/lspconfig.nix create mode 100644 config/modules/plugins/lsp/lua_ls.nix create mode 100644 config/modules/plugins/lsp/marksman.nix create mode 100644 config/modules/plugins/lsp/nixd.nix create mode 100644 config/modules/plugins/lsp/ruff.nix create mode 100644 config/modules/plugins/lsp/tflint.nix create mode 100644 config/modules/plugins/lsp/yamlls.nix create mode 100644 config/modules/plugins/mini.nix create mode 100644 config/modules/plugins/neotree.nix create mode 100644 config/modules/plugins/oil.nix create mode 100644 config/modules/plugins/snacks.nix create mode 100644 config/modules/plugins/tmux-navigator.nix create mode 100644 config/modules/plugins/treesitter.nix create mode 100644 config/modules/plugins/undotree.nix create mode 100644 config/modules/plugins/which-key.nix create mode 100644 config/options.nix delete mode 120000 config/src/lazygit/config.yml delete mode 120000 config/src/lazygit/state.yml delete mode 100644 config/src/nvim/.neoconf.json delete mode 100644 config/src/nvim/init.lua delete mode 120000 config/src/nvim/lazy-lock.json delete mode 120000 config/src/nvim/lazyvim.json delete mode 100644 config/src/nvim/lua/config/autocmds.lua delete mode 100644 config/src/nvim/lua/config/keymaps.lua delete mode 100644 config/src/nvim/lua/config/lazy.lua delete mode 100644 config/src/nvim/lua/config/options.lua delete mode 100644 config/src/nvim/lua/plugins/catppuccin.lua delete mode 100644 config/src/nvim/lua/plugins/lang/nix.lua delete mode 100644 config/src/nvim/lua/plugins/lang/shell.lua delete mode 100644 config/src/nvim/lua/plugins/misc/bigfile.lua delete mode 100644 config/src/nvim/lua/plugins/misc/tmux-navigator.lua delete mode 100644 config/src/nvim/lua/plugins/telescope.lua delete mode 100644 config/src/nvim/lua/plugins/tokyonight.lua delete mode 100644 config/src/nvim/lua/plugins/ui/colorizer.lua delete mode 100644 config/src/nvim/lua/plugins/undotree.lua delete mode 100644 config/src/nvim/stylua.toml delete mode 100644 packages/lazyVim.nix delete mode 100644 renovate.json5 delete mode 100644 runtimeDeps.nix diff --git a/.gitea/workflows/build-flake.yml b/.gitea/workflows/build-flake.yml index 79d9559..5c597cb 100644 --- a/.gitea/workflows/build-flake.yml +++ b/.gitea/workflows/build-flake.yml @@ -20,7 +20,7 @@ jobs: extra_nix_config: | experimental-features = nix-command flakes github_access_token: ${{ secrets.GH_ACCESS_TOKEN }} - nix_path: nixpkgs=channel:nixos-24.05 + nix_path: nixpkgs=channel:nixos-25.05 - uses: cachix/cachix-action@v15 with: name: palkx diff --git a/.gitingore b/.gitignore similarity index 100% rename from .gitingore rename to .gitignore diff --git a/config/default.nix b/config/default.nix index 8594138..927dd35 100644 --- a/config/default.nix +++ b/config/default.nix @@ -1,9 +1,31 @@ -{ pkgs }: -pkgs.stdenv.mkDerivation { - name = "nvim-config"; - src = ./src; - installPhase = '' - mkdir -p $out/ - cp -r . $out/ - ''; +{ + imports = [ + ./options.nix + + ./modules/colorschemes/catppuccin.nix + + ./modules/plugins/lsp + + ./modules/plugins/blink-cmp.nix + ./modules/plugins/bufferline.nix + ./modules/plugins/conform-nvim.nix + ./modules/plugins/fzf-lua.nix + ./modules/plugins/gitsigns.nix + ./modules/plugins/lazygit.nix + ./modules/plugins/mini.nix + ./modules/plugins/neotree.nix + ./modules/plugins/oil.nix + ./modules/plugins/snacks.nix + ./modules/plugins/tmux-navigator.nix + ./modules/plugins/treesitter.nix + ./modules/plugins/undotree.nix + ./modules/plugins/which-key.nix + ]; + + performance.byteCompileLua.enable = true; + performance.byteCompileLua.configs = true; + performance.byteCompileLua.initLua = true; + performance.byteCompileLua.luaLib = true; + performance.byteCompileLua.nvimRuntime = true; + performance.byteCompileLua.plugins = true; } diff --git a/config/modules/colorschemes/catppuccin.nix b/config/modules/colorschemes/catppuccin.nix new file mode 100644 index 0000000..680fd78 --- /dev/null +++ b/config/modules/colorschemes/catppuccin.nix @@ -0,0 +1,14 @@ +{ + colorschemes = { + catppuccin = { + enable = true; + settings = { + flavour = "macchiato"; + transparent_background = false; + dim_inactive = { + enabled = true; + }; + }; + }; + }; +} diff --git a/config/modules/plugins/blink-cmp.nix b/config/modules/plugins/blink-cmp.nix new file mode 100644 index 0000000..f991fde --- /dev/null +++ b/config/modules/plugins/blink-cmp.nix @@ -0,0 +1,3 @@ +{ + plugins.blink-cmp.enable = true; +} diff --git a/config/modules/plugins/bufferline.nix b/config/modules/plugins/bufferline.nix new file mode 100644 index 0000000..018faa2 --- /dev/null +++ b/config/modules/plugins/bufferline.nix @@ -0,0 +1,46 @@ +{ + plugins.bufferline.enable = true; + + keymaps = [ + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + { + mode = "n"; + key = ""; + action = "BufferLineCycleNext"; + options = { + desc = "Cycle to next buffer"; + }; + } + { + mode = "n"; + key = ""; + action = "BufferLineCyclePrev"; + options = { + desc = "Cycle to previous buffer"; + }; + } + { + mode = "n"; + key = "bd"; + action = "bdelete"; + options = { + desc = "Delete buffer"; + }; + } + ]; +} diff --git a/config/modules/plugins/conform-nvim.nix b/config/modules/plugins/conform-nvim.nix new file mode 100644 index 0000000..50dce5a --- /dev/null +++ b/config/modules/plugins/conform-nvim.nix @@ -0,0 +1,3 @@ +{ + plugins.conform-nvim.enable = true; +} diff --git a/config/modules/plugins/fzf-lua.nix b/config/modules/plugins/fzf-lua.nix new file mode 100644 index 0000000..258a759 --- /dev/null +++ b/config/modules/plugins/fzf-lua.nix @@ -0,0 +1,30 @@ +{ lib, pkgs, ... }: +{ + plugins.fzf-lua = { + enable = true; + # keymaps = { + # "sf" = { + # action = "files"; + # options = { + # desc = "Fzf-Lua File Grep"; + # }; + # }; + # "sg" = { + # action = "live_grep_native"; + # options = { + # desc = "Fzf-Lua File Grep"; + # }; + # }; + # "sv" = { + # action = "git_files"; + # # settings = { + # # previewers.cat.cmd = lib.getExe' pkgs.coreutils "cat"; + # # winopts.height = 0.5; + # # }; + # options = { + # desc = "Fzf-Lua VCS Grep (Git)"; + # }; + # }; + # }; + }; +} diff --git a/config/modules/plugins/gitsigns.nix b/config/modules/plugins/gitsigns.nix new file mode 100644 index 0000000..1bb4ed5 --- /dev/null +++ b/config/modules/plugins/gitsigns.nix @@ -0,0 +1,9 @@ +{ + plugins.gitsigns = { + enable = true; + settings = { + current_line_blame = true; + current_line_blame_formatter = " , "; + }; + }; +} diff --git a/config/modules/plugins/lazygit.nix b/config/modules/plugins/lazygit.nix new file mode 100644 index 0000000..2849a96 --- /dev/null +++ b/config/modules/plugins/lazygit.nix @@ -0,0 +1,3 @@ +{ + plugins.lazygit.enable = true; +} diff --git a/config/modules/plugins/lsp/ansiblels.nix b/config/modules/plugins/lsp/ansiblels.nix new file mode 100644 index 0000000..90e2ef4 --- /dev/null +++ b/config/modules/plugins/lsp/ansiblels.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.ansiblels.enable = true; +} diff --git a/config/modules/plugins/lsp/bashls.nix b/config/modules/plugins/lsp/bashls.nix new file mode 100644 index 0000000..2e97139 --- /dev/null +++ b/config/modules/plugins/lsp/bashls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.bashls.enable = true; +} diff --git a/config/modules/plugins/lsp/default.nix b/config/modules/plugins/lsp/default.nix new file mode 100644 index 0000000..02b0971 --- /dev/null +++ b/config/modules/plugins/lsp/default.nix @@ -0,0 +1,75 @@ +{ lib, ... }: +{ + imports = [ + # Default configurations for lsp servers + ./lspconfig.nix + + ./ansiblels.nix + ./bashls.nix + ./docker_compose_language_server.nix + ./dockerls.nix + ./gopls.nix + ./helm_ls.nix + ./jdtls.nix + ./jsonls.nix + ./jsonnet_ls.nix + ./just.nix + ./lua_ls.nix + ./marksman.nix + ./nixd.nix + ./ruff.nix + ./tflint.nix + ./yamlls.nix + ]; + + # lsp.keymaps = [ + # { + # key = "gd"; + # lspBufAction = "definition"; + # } + # { + # key = "gD"; + # lspBufAction = "references"; + # } + # { + # key = "gt"; + # lspBufAction = "type_definition"; + # } + # { + # key = "gi"; + # lspBufAction = "implementation"; + # } + # { + # key = "K"; + # lspBufAction = "hover"; + # } + # { + # action = lib.nixvim.mkRaw "function() vim.diagnostic.jump({ count=-1, float=true }) end"; + # key = "k"; + # } + # { + # action = lib.nixvim.mkRaw "function() vim.diagnostic.jump({ count=1, float=true }) end"; + # key = "j"; + # } + # { + # action = "LspStop"; + # key = "lx"; + # } + # { + # action = "LspStart"; + # key = "ls"; + # } + # { + # action = "LspRestart"; + # key = "lr"; + # } + # # { + # # action = lib.nixvim.mkRaw "require('telescope.builtin').lsp_definitions"; + # # key = "gd"; + # # } + # { + # action = "Lspsaga hover_doc"; + # key = "K"; + # } + # ]; +} diff --git a/config/modules/plugins/lsp/docker_compose_language_server.nix b/config/modules/plugins/lsp/docker_compose_language_server.nix new file mode 100644 index 0000000..a42b542 --- /dev/null +++ b/config/modules/plugins/lsp/docker_compose_language_server.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.docker_compose_language_service.enable = true; +} diff --git a/config/modules/plugins/lsp/dockerls.nix b/config/modules/plugins/lsp/dockerls.nix new file mode 100644 index 0000000..88022fd --- /dev/null +++ b/config/modules/plugins/lsp/dockerls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.dockerls.enable = true; +} diff --git a/config/modules/plugins/lsp/gopls.nix b/config/modules/plugins/lsp/gopls.nix new file mode 100644 index 0000000..42b315b --- /dev/null +++ b/config/modules/plugins/lsp/gopls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.gopls.enable = true; +} diff --git a/config/modules/plugins/lsp/helm_ls.nix b/config/modules/plugins/lsp/helm_ls.nix new file mode 100644 index 0000000..f3a3a8e --- /dev/null +++ b/config/modules/plugins/lsp/helm_ls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.helm_ls.enable = true; +} diff --git a/config/modules/plugins/lsp/jdtls.nix b/config/modules/plugins/lsp/jdtls.nix new file mode 100644 index 0000000..68a52bd --- /dev/null +++ b/config/modules/plugins/lsp/jdtls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.jdtls.enable = true; +} diff --git a/config/modules/plugins/lsp/jsonls.nix b/config/modules/plugins/lsp/jsonls.nix new file mode 100644 index 0000000..dda6939 --- /dev/null +++ b/config/modules/plugins/lsp/jsonls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.jsonls.enable = true; +} diff --git a/config/modules/plugins/lsp/jsonnet_ls.nix b/config/modules/plugins/lsp/jsonnet_ls.nix new file mode 100644 index 0000000..3ecde48 --- /dev/null +++ b/config/modules/plugins/lsp/jsonnet_ls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.jsonnet_ls.enable = true; +} diff --git a/config/modules/plugins/lsp/just.nix b/config/modules/plugins/lsp/just.nix new file mode 100644 index 0000000..9cc5161 --- /dev/null +++ b/config/modules/plugins/lsp/just.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.just.enable = true; +} diff --git a/config/modules/plugins/lsp/lspconfig.nix b/config/modules/plugins/lsp/lspconfig.nix new file mode 100644 index 0000000..3bbe43a --- /dev/null +++ b/config/modules/plugins/lsp/lspconfig.nix @@ -0,0 +1,3 @@ +{ + plugins.lspconfig.enable = true; +} diff --git a/config/modules/plugins/lsp/lua_ls.nix b/config/modules/plugins/lsp/lua_ls.nix new file mode 100644 index 0000000..7cf8c07 --- /dev/null +++ b/config/modules/plugins/lsp/lua_ls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.lua_ls.enable = true; +} diff --git a/config/modules/plugins/lsp/marksman.nix b/config/modules/plugins/lsp/marksman.nix new file mode 100644 index 0000000..1066355 --- /dev/null +++ b/config/modules/plugins/lsp/marksman.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.marksman.enable = true; +} diff --git a/config/modules/plugins/lsp/nixd.nix b/config/modules/plugins/lsp/nixd.nix new file mode 100644 index 0000000..8fe9bb4 --- /dev/null +++ b/config/modules/plugins/lsp/nixd.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.nixd.enable = true; +} diff --git a/config/modules/plugins/lsp/ruff.nix b/config/modules/plugins/lsp/ruff.nix new file mode 100644 index 0000000..3aed3c5 --- /dev/null +++ b/config/modules/plugins/lsp/ruff.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.ruff.enable = true; +} diff --git a/config/modules/plugins/lsp/tflint.nix b/config/modules/plugins/lsp/tflint.nix new file mode 100644 index 0000000..f251245 --- /dev/null +++ b/config/modules/plugins/lsp/tflint.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.tflint.enable = true; +} diff --git a/config/modules/plugins/lsp/yamlls.nix b/config/modules/plugins/lsp/yamlls.nix new file mode 100644 index 0000000..4300d95 --- /dev/null +++ b/config/modules/plugins/lsp/yamlls.nix @@ -0,0 +1,3 @@ +{ + lsp.servers.yamlls.enable = true; +} diff --git a/config/modules/plugins/mini.nix b/config/modules/plugins/mini.nix new file mode 100644 index 0000000..991a0fa --- /dev/null +++ b/config/modules/plugins/mini.nix @@ -0,0 +1,11 @@ +{ + plugins.mini = { + enable = true; + mockDevIcons = true; + modules = { + icons = { }; + comment = { }; + diff = { }; + }; + }; +} diff --git a/config/modules/plugins/neotree.nix b/config/modules/plugins/neotree.nix new file mode 100644 index 0000000..f7a2444 --- /dev/null +++ b/config/modules/plugins/neotree.nix @@ -0,0 +1,32 @@ +{ + plugins.neo-tree = { + enable = true; + enableDiagnostics = true; + enableGitStatus = true; + enableModifiedMarkers = true; + enableRefreshOnWrite = true; + closeIfLastWindow = true; + popupBorderStyle = "rounded"; # Type: null or one of “NC”, “double”, “none”, “rounded”, “shadow”, “single”, “solid” or raw lua code + buffers = { + bindToCwd = false; + followCurrentFile = { + enabled = true; + }; + }; + window = { + width = 40; + height = 15; + autoExpandWidth = false; + mappings = { + "" = "none"; + }; + }; + }; + + keymaps = [ + { + action = "Neotree toggle"; + key = "e"; + } + ]; +} diff --git a/config/modules/plugins/oil.nix b/config/modules/plugins/oil.nix new file mode 100644 index 0000000..516c939 --- /dev/null +++ b/config/modules/plugins/oil.nix @@ -0,0 +1,14 @@ +{ + plugins.oil.enable = true; + + keymaps = [ + { + mode = "n"; + action = "Oil"; + key = "o"; + options = { + desc = "Open [O]il"; + }; + } + ]; +} diff --git a/config/modules/plugins/snacks.nix b/config/modules/plugins/snacks.nix new file mode 100644 index 0000000..55cc59b --- /dev/null +++ b/config/modules/plugins/snacks.nix @@ -0,0 +1,491 @@ +{ lib, ... }: +{ + plugins.snacks = { + enable = true; + settings = { + bigfile.enabled = true; + notifier.enabled = true; + quickfile.enabled = true; + statuscolumn.enabled = true; + words.enabled = true; + lazygit.enabled = true; + picker.enabled = true; + }; + }; + + keymaps = [ + { + key = ""; + action = lib.nixvim.mkRaw "function() Snacks.picker.smart() end"; + options = { + desc = "Smart Find Files"; + }; + } + { + key = ","; + action = lib.nixvim.mkRaw "function() Snacks.picker.buffers() end"; + options = { + desc = "Buffers"; + }; + } + { + key = "/"; + action = lib.nixvim.mkRaw "function() Snacks.picker.grep() end"; + options = { + desc = "Grep"; + }; + } + { + key = ":"; + action = lib.nixvim.mkRaw "function() Snacks.picker.command_history() end"; + options = { + desc = "Command History"; + }; + } + { + key = "n"; + action = lib.nixvim.mkRaw "function() Snacks.picker.notifications() end"; + options = { + desc = "Notification History"; + }; + } + { + key = "e"; + action = lib.nixvim.mkRaw "function() Snacks.explorer() end"; + options = { + desc = "File Explorer"; + }; + } + { + key = "fb"; + action = lib.nixvim.mkRaw "function() Snacks.picker.buffers() end"; + options = { + desc = "Buffers"; + }; + } + { + key = "fc"; + action = lib.nixvim.mkRaw "function() Snacks.picker.files({ cwd = vim.fn.stdpath(\"config\") }) end"; + options = { + desc = "Find Config File"; + }; + } + { + key = "ff"; + action = lib.nixvim.mkRaw "function() Snacks.picker.files() end"; + options = { + desc = "Find Files"; + }; + } + { + key = "fg"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_files() end"; + options = { + desc = "Find Git Files"; + }; + } + { + key = "fp"; + action = lib.nixvim.mkRaw "function() Snacks.picker.projects() end"; + options = { + desc = "Projects"; + }; + } + { + key = "fr"; + action = lib.nixvim.mkRaw "function() Snacks.picker.recent() end"; + options = { + desc = "Recent"; + }; + } + { + key = "gb"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_branches() end"; + options = { + desc = "Git Branches"; + }; + } + { + key = "gl"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_log() end"; + options = { + desc = "Git Log"; + }; + } + { + key = "gL"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_log_line() end"; + options = { + desc = "Git Log Line"; + }; + } + { + key = "gs"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_status() end"; + options = { + desc = "Git Status"; + }; + } + { + key = "gS"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_stash() end"; + options = { + desc = "Git Stash"; + }; + } + { + key = "gd"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_diff() end"; + options = { + desc = "Git Diff (Hunks)"; + }; + } + { + key = "gf"; + action = lib.nixvim.mkRaw "function() Snacks.picker.git_log_file() end"; + options = { + desc = "Git Log File"; + }; + } + { + key = "sb"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lines() end"; + options = { + desc = "Buffer Lines"; + }; + } + { + key = "sB"; + action = lib.nixvim.mkRaw "function() Snacks.picker.grep_buffers() end"; + options = { + desc = "Grep Open Buffers"; + }; + } + { + key = "sg"; + action = lib.nixvim.mkRaw "function() Snacks.picker.grep() end"; + options = { + desc = "Grep"; + }; + } + { + key = "sw"; + action = lib.nixvim.mkRaw "function() Snacks.picker.grep_word() end"; + options = { + desc = "Visual selection or word"; + }; + mode = "n"; + } + { + key = "s\""; + action = lib.nixvim.mkRaw "function() Snacks.picker.registers() end"; + options = { + desc = "Registers"; + }; + } + { + key = "s/"; + action = lib.nixvim.mkRaw "function() Snacks.picker.search_history() end"; + options = { + desc = "Search History"; + }; + } + { + key = "sa"; + action = lib.nixvim.mkRaw "function() Snacks.picker.autocmds() end"; + options = { + desc = "Autocmds"; + }; + } + { + key = "sb"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lines() end"; + options = { + desc = "Buffer Lines"; + }; + } + { + key = "sc"; + action = lib.nixvim.mkRaw "function() Snacks.picker.command_history() end"; + options = { + desc = "Command History"; + }; + } + { + key = "sC"; + action = lib.nixvim.mkRaw "function() Snacks.picker.commands() end"; + options = { + desc = "Commands"; + }; + } + { + key = "sd"; + action = lib.nixvim.mkRaw "function() Snacks.picker.diagnostics() end"; + options = { + desc = "Diagnostics"; + }; + } + { + key = "sD"; + action = lib.nixvim.mkRaw "function() Snacks.picker.diagnostics_buffer() end"; + options = { + desc = "Buffer Diagnostics"; + }; + } + { + key = "sh"; + action = lib.nixvim.mkRaw "function() Snacks.picker.help() end"; + options = { + desc = "Help Pages"; + }; + } + { + key = "sH"; + action = lib.nixvim.mkRaw "function() Snacks.picker.highlights() end"; + options = { + desc = "Highlights"; + }; + } + { + key = "si"; + action = lib.nixvim.mkRaw "function() Snacks.picker.icons() end"; + options = { + desc = "Icons"; + }; + } + { + key = "sj"; + action = lib.nixvim.mkRaw "function() Snacks.picker.jumps() end"; + options = { + desc = "Jumps"; + }; + } + { + key = "sk"; + action = lib.nixvim.mkRaw "function() Snacks.picker.keymaps() end"; + options = { + desc = "Keymaps"; + }; + } + { + key = "sl"; + action = lib.nixvim.mkRaw "function() Snacks.picker.loclist() end"; + options = { + desc = "Location List"; + }; + } + { + key = "sm"; + action = lib.nixvim.mkRaw "function() Snacks.picker.marks() end"; + options = { + desc = "Marks"; + }; + } + { + key = "sM"; + action = lib.nixvim.mkRaw "function() Snacks.picker.man() end"; + options = { + desc = "Man Pages"; + }; + } + { + key = "sp"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lazy() end"; + options = { + desc = "Search for Plugin Spec"; + }; + } + { + key = "sq"; + action = lib.nixvim.mkRaw "function() Snacks.picker.qflist() end"; + options = { + desc = "Quickfix List"; + }; + } + { + key = "sR"; + action = lib.nixvim.mkRaw "function() Snacks.picker.resume() end"; + options = { + desc = "Resume"; + }; + } + { + key = "su"; + action = lib.nixvim.mkRaw "function() Snacks.picker.undo() end"; + options = { + desc = "Undo History"; + }; + } + { + key = "uC"; + action = lib.nixvim.mkRaw "function() Snacks.picker.colorschemes() end"; + options = { + desc = "Colorschemes"; + }; + } + { + key = "gd"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_definitions() end"; + options = { + desc = "Goto Definition"; + }; + } + { + key = "gD"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_declarations() end"; + options = { + desc = "Goto Declaration"; + }; + } + { + key = "gr"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_references() end"; + options = { + desc = "References"; + }; + } + { + key = "gI"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_implementations() end"; + options = { + desc = "Goto Implementation"; + }; + } + { + key = "gy"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_type_definitions() end"; + options = { + desc = "Goto T[y]pe Definition"; + }; + } + { + key = "gai"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_incoming_calls() end"; + options = { + desc = "C[a]lls Incoming"; + }; + } + { + key = "gao"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_outgoing_calls() end"; + options = { + desc = "C[a]lls Outgoing"; + }; + } + { + key = "ss"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_symbols() end"; + options = { + desc = "LSP Symbols"; + }; + } + { + key = "sS"; + action = lib.nixvim.mkRaw "function() Snacks.picker.lsp_workspace_symbols() end"; + options = { + desc = "LSP Workspace Symbols"; + }; + } + { + key = "z"; + action = lib.nixvim.mkRaw "function() Snacks.zen() end"; + options = { + desc = "Toggle Zen Mode"; + }; + } + { + key = "Z"; + action = lib.nixvim.mkRaw "function() Snacks.zen.zoom() end"; + options = { + desc = "Toggle Zoom"; + }; + } + { + key = "."; + action = lib.nixvim.mkRaw "function() Snacks.scratch() end"; + options = { + desc = "Toggle Scratch Buffer"; + }; + } + { + key = "S"; + action = lib.nixvim.mkRaw "function() Snacks.scratch.select() end"; + options = { + desc = "Select Scratch Buffer"; + }; + } + { + key = "n"; + action = lib.nixvim.mkRaw "function() Snacks.notifier.show_history() end"; + options = { + desc = "Notification History"; + }; + } + { + key = "bd"; + action = lib.nixvim.mkRaw "function() Snacks.bufdelete() end"; + options = { + desc = "Delete Buffer"; + }; + } + { + key = "cR"; + action = lib.nixvim.mkRaw "function() Snacks.rename.rename_file() end"; + options = { + desc = "Rename File"; + }; + } + { + key = "gB"; + action = lib.nixvim.mkRaw "function() Snacks.gitbrowse() end"; + options = { + desc = "Git Browse"; + }; + mode = "n"; + } + { + key = "gg"; + action = lib.nixvim.mkRaw "function() Snacks.lazygit() end"; + options = { + desc = "Lazygit"; + }; + } + { + key = "un"; + action = lib.nixvim.mkRaw "function() Snacks.notifier.hide() end"; + options = { + desc = "Dismiss All Notifications"; + }; + } + { + key = ""; + action = lib.nixvim.mkRaw "function() Snacks.terminal() end"; + options = { + desc = "Toggle Terminal"; + }; + } + { + key = ""; + action = lib.nixvim.mkRaw "function() Snacks.terminal() end"; + options = { + desc = "which_key_ignore"; + }; + } + { + key = "]]"; + action = lib.nixvim.mkRaw "function() Snacks.words.jump(vim.v.count1) end"; + options = { + desc = "Next Reference"; + }; + mode = "n"; + } + { + key = "[["; + action = lib.nixvim.mkRaw "function() Snacks.words.jump(-vim.v.count1) end"; + options = { + desc = "Prev Reference"; + }; + mode = "n"; + } + ]; +} diff --git a/config/modules/plugins/tmux-navigator.nix b/config/modules/plugins/tmux-navigator.nix new file mode 100644 index 0000000..d9bebb4 --- /dev/null +++ b/config/modules/plugins/tmux-navigator.nix @@ -0,0 +1,3 @@ +{ + plugins.tmux-navigator.enable = true; +} diff --git a/config/modules/plugins/treesitter.nix b/config/modules/plugins/treesitter.nix new file mode 100644 index 0000000..da1b05c --- /dev/null +++ b/config/modules/plugins/treesitter.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + plugins = { + treesitter = { + enable = true; + + settings = { + indent = { + enable = true; + }; + highlight = { + enable = true; + }; + }; + + nixvimInjections = true; + grammarPackages = pkgs.vimPlugins.nvim-treesitter.allGrammars; + }; + + treesitter-context = { + enable = false; + }; + + treesitter-textobjects = { + enable = true; + select = { + enable = true; + lookahead = true; + }; + }; + }; + extraConfigLua = '' + local parser_config = require("nvim-treesitter.parsers").get_parser_configs() + ''; +} diff --git a/config/modules/plugins/undotree.nix b/config/modules/plugins/undotree.nix new file mode 100644 index 0000000..8a93392 --- /dev/null +++ b/config/modules/plugins/undotree.nix @@ -0,0 +1,14 @@ +{ + plugins.undotree.enable = true; + + keymaps = [ + { + mode = "n"; + key = "ut"; + action = "UndotreeToggle"; + options = { + desc = "Undotree"; + }; + } + ]; +} diff --git a/config/modules/plugins/which-key.nix b/config/modules/plugins/which-key.nix new file mode 100644 index 0000000..f075fae --- /dev/null +++ b/config/modules/plugins/which-key.nix @@ -0,0 +1,5 @@ +{ + plugins.which-key = { + enable = true; + }; +} diff --git a/config/options.nix b/config/options.nix new file mode 100644 index 0000000..c7f4bf5 --- /dev/null +++ b/config/options.nix @@ -0,0 +1,115 @@ +{ pkgs, ... }: +{ + globalOpts = { + # Line numbers + number = true; + relativenumber = true; + + # Enable more colors (24-bit) + termguicolors = true; + + # Have a better completion experience + completeopt = [ + "menuone" + "noselect" + "noinsert" + ]; + + # Always show the signcolumn, otherwise text would be shifted when displaying error icons + signcolumn = "yes:3"; + + # Enable mouse + mouse = "a"; + + # Search + ignorecase = true; + smartcase = true; + + # Configure how new splits should be opened + splitright = true; + splitbelow = true; + + list = true; + # NOTE: .__raw here means that this field is raw lua code + listchars.__raw = "{ tab = '» ', trail = '·', nbsp = '␣' }"; + + expandtab = true; + tabstop = 2; + shiftwidth = 2; + softtabstop = 0; + smarttab = true; + + # Set encoding + encoding = "utf-8"; + fileencoding = "utf-8"; + + # Save undo history + undofile = true; + swapfile = true; + backup = false; + autoread = true; + + # Highlight the current line for cursor + cursorline = true; + + # Show line and column when searching + ruler = true; + + # Global substitution by default + gdefault = true; + + # Start scrolling when the cursor is X lines away from the top/bottom + scrolloff = 5; + }; + + diagnostic.settings = { + update_in_insert = true; + severity_sort = true; + float = { + border = "rounded"; + }; + jump = { + severity.__raw = "vim.diagnostic.severity.WARN"; + }; + }; + + # userCommands = { + # Q.command = "q"; + # Q.bang = true; + # Wq.command = "q"; + # Wq.bang = true; + # WQ.command = "q"; + # WQ.bang = true; + # W.command = "q"; + # W.bang = true; + # }; + + globals.mapleader = ","; + + # autoCmd = [ + # { + # event = [ "VimEnter" ]; + # callback = { + # __raw = "function() if vim.fn.argv(0) == '' then require('telescope.builtin').find_files() end end"; + # }; + # } + # { + # event = [ "VimEnter" ]; + # command = "set relativenumber"; + # } + # ]; + #autoCmd = [ + # { + # event = [ "BufEnter" "BufWinEnter" ]; + # pattern = [ "*.md" "*.mdx" ]; + # command = "MarkdownPreviewToggle"; + # } + #]; + + # highlight = { + # Comment.fg = "#ff00ff"; + # Comment.bg = "#000000"; + # Comment.underline = true; + # Comment.bold = true; + # }; +} diff --git a/config/src/lazygit/config.yml b/config/src/lazygit/config.yml deleted file mode 120000 index 0566b1c..0000000 --- a/config/src/lazygit/config.yml +++ /dev/null @@ -1 +0,0 @@ -/tmp/lazyvim-lazygit/config.yml \ No newline at end of file diff --git a/config/src/lazygit/state.yml b/config/src/lazygit/state.yml deleted file mode 120000 index 62bcf51..0000000 --- a/config/src/lazygit/state.yml +++ /dev/null @@ -1 +0,0 @@ -/tmp/lazyvim-lazygit/state.yml \ No newline at end of file diff --git a/config/src/nvim/.neoconf.json b/config/src/nvim/.neoconf.json deleted file mode 100644 index 7c48087..0000000 --- a/config/src/nvim/.neoconf.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "neodev": { - "library": { - "enabled": true, - "plugins": true - } - }, - "neoconf": { - "plugins": { - "lua_ls": { - "enabled": true - } - } - } -} diff --git a/config/src/nvim/init.lua b/config/src/nvim/init.lua deleted file mode 100644 index 5f55379..0000000 --- a/config/src/nvim/init.lua +++ /dev/null @@ -1,8 +0,0 @@ --- Configure symlinks needed by LazyVim -vim.fn.system({ "mkdir", "-p", os.getenv("HOME") .. "/.config/lazyvim/nvim" }) -vim.fn.system({ "mkdir", "-p", os.getenv("HOME") .. "/.config/lazyvim/lazygit" }) -vim.fn.system({ "ln", "-sfT", os.getenv("HOME") .. "/.config/lazyvim/nvim", "/tmp/lazyvim-nvim" }) -vim.fn.system({ "ln", "-sfT", os.getenv("HOME") .. "/.config/lazyvim/lazygit", "/tmp/lazyvim-lazygit" }) - --- Load lazyvim -require("config.lazy") diff --git a/config/src/nvim/lazy-lock.json b/config/src/nvim/lazy-lock.json deleted file mode 120000 index 005bf03..0000000 --- a/config/src/nvim/lazy-lock.json +++ /dev/null @@ -1 +0,0 @@ -/tmp/lazyvim-nvim/lazy-lock.json \ No newline at end of file diff --git a/config/src/nvim/lazyvim.json b/config/src/nvim/lazyvim.json deleted file mode 120000 index 454fed1..0000000 --- a/config/src/nvim/lazyvim.json +++ /dev/null @@ -1 +0,0 @@ -/tmp/lazyvim-nvim/lazyvim.json \ No newline at end of file diff --git a/config/src/nvim/lua/config/autocmds.lua b/config/src/nvim/lua/config/autocmds.lua deleted file mode 100644 index 27e9e06..0000000 --- a/config/src/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Autocmds are automatically loaded on the VeryLazy event --- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua --- Add any additional autocmds here diff --git a/config/src/nvim/lua/config/keymaps.lua b/config/src/nvim/lua/config/keymaps.lua deleted file mode 100644 index 2c134f7..0000000 --- a/config/src/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,3 +0,0 @@ --- Keymaps are automatically loaded on the VeryLazy event --- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua --- Add any additional keymaps here diff --git a/config/src/nvim/lua/config/lazy.lua b/config/src/nvim/lua/config/lazy.lua deleted file mode 100644 index 7477963..0000000 --- a/config/src/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,60 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", - lazypath }) -end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) - -require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- Blink currently not supported by all extras 2024-11-19 11:08 - -- { import = "lazyvim.plugins.extras.coding.blink" }, - { import = "lazyvim.plugins.extras.editor.illuminate" }, - { import = "lazyvim.plugins.extras.editor.outline" }, - { import = "lazyvim.plugins.extras.editor.telescope" }, - { import = "lazyvim.plugins.extras.formatting.prettier" }, - { import = "lazyvim.plugins.extras.lang.ansible" }, - { import = "lazyvim.plugins.extras.lang.docker" }, - { import = "lazyvim.plugins.extras.lang.git" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.helm" }, - { import = "lazyvim.plugins.extras.lang.java" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.markdown" }, - { import = "lazyvim.plugins.extras.lang.nix" }, - { import = "lazyvim.plugins.extras.lang.python" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.scala" }, - { import = "lazyvim.plugins.extras.lang.sql" }, - { import = "lazyvim.plugins.extras.lang.terraform" }, - { import = "lazyvim.plugins.extras.lang.toml" }, - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.lang.yaml" }, - { import = "lazyvim.plugins.extras.ui.mini-animate" }, - { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, - { import = "lazyvim.plugins.extras.ui.treesitter-context" }, - { import = "plugins.catppuccin" }, - { import = "plugins.lang.shell" }, - { import = "plugins.misc.tmux-navigator" }, - }, - defaults = { - -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. - -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. - lazy = false, - -- It's recommended to leave version=false for now, since a lot the plugin that support versioning, - -- have outdated releases, which may break your Neovim install. - version = nil, -- always use the latest git commit - -- version = "*", -- try installing the latest stable version for plugins that support semver - }, - install = { colorscheme = { "catppuccin-macchiato" } }, - checker = { enabled = true, frequency = 60 * 60 * 24 }, -- automatically check for plugin updates once per day - performance = { - cache = { - enabled = true, - }, - }, -}) diff --git a/config/src/nvim/lua/config/options.lua b/config/src/nvim/lua/config/options.lua deleted file mode 100644 index 4775f20..0000000 --- a/config/src/nvim/lua/config/options.lua +++ /dev/null @@ -1,7 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here -vim.g.mapleader = "," - -vim.opt.number = true -vim.opt.relativenumber = false diff --git a/config/src/nvim/lua/plugins/catppuccin.lua b/config/src/nvim/lua/plugins/catppuccin.lua deleted file mode 100644 index 378353b..0000000 --- a/config/src/nvim/lua/plugins/catppuccin.lua +++ /dev/null @@ -1,62 +0,0 @@ -return { - "catppuccin/nvim", - lazy = true, - name = "catppuccin", - opts = { - flavour = "macchiato", - transparent_background = false, - integrations = { - aerial = true, - alpha = true, - cmp = true, - dashboard = true, - flash = true, - grug_far = true, - gitsigns = true, - headlines = true, - illuminate = true, - indent_blankline = { enabled = true }, - leap = true, - lsp_trouble = true, - mason = true, - markdown = true, - mini = true, - native_lsp = { - enabled = true, - underlines = { - errors = { "undercurl" }, - hints = { "undercurl" }, - warnings = { "undercurl" }, - information = { "undercurl" }, - }, - }, - navic = { enabled = true, custom_bg = "lualine" }, - neotest = true, - neotree = true, - noice = true, - notify = true, - semantic_tokens = true, - telescope = true, - treesitter = true, - treesitter_context = true, - which_key = true, - }, - }, - specs = { - { - "akinsho/bufferline.nvim", - optional = true, - opts = function(_, opts) - if (vim.g.colors_name or ""):find("catppuccin") then - opts.highlights = require("catppuccin.groups.integrations.bufferline").get() - end - end, - }, - }, - { - "LazyVim/LazyVim", - opts = { - colorscheme = "catppuccin-macchiato", - }, - }, -} diff --git a/config/src/nvim/lua/plugins/lang/nix.lua b/config/src/nvim/lua/plugins/lang/nix.lua deleted file mode 100644 index b8e9a2a..0000000 --- a/config/src/nvim/lua/plugins/lang/nix.lua +++ /dev/null @@ -1,41 +0,0 @@ -return { - { - "stevearc/conform.nvim", - optional = true, - opts = { - formatters_by_ft = { - ["nix"] = { "alejandra" }, - }, - }, - }, - { - "neovim/nvim-lspconfig", - opts = { - servers = { - nixd = {}, - }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { - "nix", - }) - end - end, - }, - { - "nvimtools/none-ls.nvim", - optional = true, - opts = function(_, opts) - local null_ls = require("null-ls") - opts.sources = vim.list_extend(opts.sources or {}, { - null_ls.builtins.code_actions.statix, - null_ls.builtins.diagnostics.statix, - null_ls.builtins.formatting.alejandra, - }) - end, - }, -} diff --git a/config/src/nvim/lua/plugins/lang/shell.lua b/config/src/nvim/lua/plugins/lang/shell.lua deleted file mode 100644 index e694b75..0000000 --- a/config/src/nvim/lua/plugins/lang/shell.lua +++ /dev/null @@ -1,47 +0,0 @@ -return { - { - "williamboman/mason.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - vim.list_extend(opts.ensure_installed, { - "shfmt", - "shellcheck", - "bash-language-server", - }) - end, - }, - { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - opts = { - formatters_by_ft = { - ["sh"] = { "shfmt" }, - ["command"] = { "shfmt" }, - }, - formatters = { - shfmt = { - prepend_args = { "-i", "2", "-ci" }, - }, - }, - }, - }, - { - "neovim/nvim-lspconfig", - opts = { - servers = { - bashls = {}, - }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - if type(opts.ensure_installed) == "table" then - vim.list_extend(opts.ensure_installed, { - "bash", - }) - end - end, - }, -} diff --git a/config/src/nvim/lua/plugins/misc/bigfile.lua b/config/src/nvim/lua/plugins/misc/bigfile.lua deleted file mode 100644 index 3292ec7..0000000 --- a/config/src/nvim/lua/plugins/misc/bigfile.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - -- Disable certain features if file is big - { - "LunarVim/bigfile.nvim", - opts = { - filesize = 0.5, - }, - }, -} diff --git a/config/src/nvim/lua/plugins/misc/tmux-navigator.lua b/config/src/nvim/lua/plugins/misc/tmux-navigator.lua deleted file mode 100644 index 4421fed..0000000 --- a/config/src/nvim/lua/plugins/misc/tmux-navigator.lua +++ /dev/null @@ -1,17 +0,0 @@ -return { - "christoomey/vim-tmux-navigator", - cmd = { - "TmuxNavigateLeft", - "TmuxNavigateDown", - "TmuxNavigateUp", - "TmuxNavigateRight", - "TmuxNavigatePrevious", - }, - keys = { - { "", "TmuxNavigateLeft" }, - { "", "TmuxNavigateDown" }, - { "", "TmuxNavigateUp" }, - { "", "TmuxNavigateRight" }, - { "", "TmuxNavigatePrevious" }, - }, -} diff --git a/config/src/nvim/lua/plugins/telescope.lua b/config/src/nvim/lua/plugins/telescope.lua deleted file mode 100644 index 48c3626..0000000 --- a/config/src/nvim/lua/plugins/telescope.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - "nvim-telescope/telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - opts = { - defaults = { - file_ignore_patterns = { - ".git/", - "^node_modules/", - ".cache", - }, - }, - pickers = { - live_grep = { - additional_args = { "-L" }, - }, - grep_string = { - additional_args = { "-L" }, - }, - find_files = { - hidden = true, - follow = true, - }, - }, - }, -} diff --git a/config/src/nvim/lua/plugins/tokyonight.lua b/config/src/nvim/lua/plugins/tokyonight.lua deleted file mode 100644 index 6dcb72f..0000000 --- a/config/src/nvim/lua/plugins/tokyonight.lua +++ /dev/null @@ -1,10 +0,0 @@ -return { - "folke/tokyonight.nvim", - opts = { - transparent = true, - styles = { - sidebars = "transparent", - floats = "transparent", - }, - }, -} diff --git a/config/src/nvim/lua/plugins/ui/colorizer.lua b/config/src/nvim/lua/plugins/ui/colorizer.lua deleted file mode 100644 index 91a6b45..0000000 --- a/config/src/nvim/lua/plugins/ui/colorizer.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "chrisbra/Colorizer", - keys = { - { "uR", "ColorToggle", desc = "Toggle Colorizer" }, - }, -} diff --git a/config/src/nvim/lua/plugins/undotree.lua b/config/src/nvim/lua/plugins/undotree.lua deleted file mode 100644 index 27126a4..0000000 --- a/config/src/nvim/lua/plugins/undotree.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "mbbill/undotree", - keys = { - { "u", " UndotreeToggle ", desc = "Toggle undotree", mode = { "n" } }, - }, -} diff --git a/config/src/nvim/stylua.toml b/config/src/nvim/stylua.toml deleted file mode 100644 index 0f90030..0000000 --- a/config/src/nvim/stylua.toml +++ /dev/null @@ -1,3 +0,0 @@ -indent_type = "Spaces" -indent_width = 2 -column_width = 120 diff --git a/flake.lock b/flake.lock index b834b34..f085389 100644 --- a/flake.lock +++ b/flake.lock @@ -1,50 +1,15 @@ { "nodes": { - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { - "nixpkgs-lib": [ - "neovim-nightly-overlay", - "nixpkgs" - ] + "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "lastModified": 1760948891, + "narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04", "type": "github" }, "original": { @@ -56,22 +21,22 @@ "flake-parts_2": { "inputs": { "nixpkgs-lib": [ - "neovim-nightly-overlay", - "hercules-ci-effects", + "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "lastModified": 1759362264, + "narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "rev": "758cf7296bee11f1706a574c77d072b8a7baa881", "type": "github" }, "original": { - "id": "flake-parts", - "type": "indirect" + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" } }, "flake-utils": { @@ -92,141 +57,118 @@ "type": "github" } }, - "git-hooks": { + "ixx": { "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" ], - "nixpkgs-stable": [ - "neovim-nightly-overlay", + "nixpkgs": [ + "nixvim", + "nuschtosSearch", "nixpkgs" ] }, "locked": { - "lastModified": 1734797603, - "narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498", + "lastModified": 1754860581, + "narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281", "type": "github" }, "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "neovim-nightly-overlay", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "hercules-ci-effects": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1733333617, - "narHash": "sha256-nMMQXREGvLOLvUa0ByhYFdaL0Jov0t1wzLbKjr05P2w=", - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "rev": "56f8ea8d502c87cf62444bec4ee04512e8ea24ea", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "hercules-ci-effects", - "type": "github" - } - }, - "neovim-nightly-overlay": { - "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", - "git-hooks": "git-hooks", - "hercules-ci-effects": "hercules-ci-effects", - "neovim-src": "neovim-src", - "nixpkgs": [ - "nixpkgs" - ], - "treefmt-nix": "treefmt-nix" - }, - "locked": { - "lastModified": 1735141262, - "narHash": "sha256-AZPN+QVvVF+bhZAumVicFCC791g4av9U/4m7mOIo4wQ=", - "owner": "nix-community", - "repo": "neovim-nightly-overlay", - "rev": "54f4dbfdc4304444c43b11be1e63471005aa1d05", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "54f4dbfdc4304444c43b11be1e63471005aa1d05", - "repo": "neovim-nightly-overlay", - "type": "github" - } - }, - "neovim-src": { - "flake": false, - "locked": { - "lastModified": 1734989976, - "narHash": "sha256-DVlI7ua+VOkqC70WpSbJO+FjQyBEarGZnKoql7I7Unk=", - "owner": "neovim", - "repo": "neovim", - "rev": "c51bf5a6b24928ac04d0bb129b1b424d4c78f28d", - "type": "github" - }, - "original": { - "owner": "neovim", - "repo": "neovim", + "owner": "NuschtOS", + "ref": "v0.1.1", + "repo": "ixx", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1735141468, - "narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=", + "lastModified": 1761016216, + "narHash": "sha256-G/iC4t/9j/52i/nm+0/4ybBmAF4hzR8CNHC75qEhjHo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce", + "rev": "481cf557888e05d3128a76f14c76397b7d7cc869", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1754788789, + "narHash": "sha256-x2rJ+Ovzq0sCMpgfgGaaqgBSwY+LST+WbZ6TytnT9Rk=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "a73b9c743612e4244d865a2fdee11865283c04e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1760795571, + "narHash": "sha256-gi+tWWAknKuTNso3yMeKsT9nj0jx+tuYF7g7nmLUWT8=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "6c945865ba5de87fa2d0dd8a0e66ca572ddf9043", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-25.05", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1760652422, + "narHash": "sha256-C88Pgz38QIl9JxQceexqL2G7sw9vodHWx1Uaq+NRJrw=", + "owner": "NuschtOS", + "repo": "search", + "rev": "3ebeebe8b6a49dfb11f771f761e0310f7c48d726", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, "root": { "inputs": { - "flake-utils": "flake-utils", - "neovim-nightly-overlay": "neovim-nightly-overlay", - "nixpkgs": "nixpkgs" + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs", + "nixvim": "nixvim", + "systems": "systems_3" } }, "systems": { @@ -244,24 +186,33 @@ "type": "github" } }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "neovim-nightly-overlay", - "nixpkgs" - ] - }, + "systems_2": { "locked": { - "lastModified": 1734982074, - "narHash": "sha256-N7M37KP7cHWoXicuE536GrVvU8nMDT/gpI1kja2hkdg=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "e41e948cf097cbf96ba4dff47a30ea6891af9f33", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { - "owner": "numtide", - "repo": "treefmt-nix", + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", "type": "github" } } diff --git a/flake.nix b/flake.nix index f89d933..ca3ec33 100644 --- a/flake.nix +++ b/flake.nix @@ -1,59 +1,55 @@ { - description = "NVIM Configuration"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; - flake-utils.url = "github:numtide/flake-utils"; - neovim-nightly-overlay = { - url = "github:nix-community/neovim-nightly-overlay?ref=54f4dbfdc4304444c43b11be1e63471005aa1d05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - }; + description = "Neovim configuration, declaratively written using nix"; - nixConfig = { - trusted-substituters = [ - "https://nix-community.cachix.org" - "https://palkx.cachix.org" - ]; - extra-trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "palkx.cachix.org-1:qaQoL5CXpGzUbqsIvxUEL7wUhoIrjV0Q8M4HbJ8/8S4=" - ]; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; + + nixvim.url = "github:nix-community/nixvim/nixos-25.05"; + nixvim.inputs.nixpkgs.follows = "nixpkgs"; + + flake-parts.url = "github:hercules-ci/flake-parts"; + + systems.url = "github:nix-systems/default"; }; outputs = - inputs@{ - nixpkgs, - flake-utils, - neovim-nightly-overlay, + { + nixvim, + flake-parts, ... - }: - flake-utils.lib.eachDefaultSystem ( - system: - let - overlayFlakeInputs = prev: final: { - neovim = neovim-nightly-overlay.packages.${system}.default.overrideAttrs (oa: { - nativeBuildInputs = oa.nativeBuildInputs ++ [ final.libtermkey ]; - }); - }; + }@inputs: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = import inputs.systems; - overlayLazyVim = prev: final: { lazyVim = import ./packages/lazyVim.nix { pkgs = final; }; }; + perSystem = + { + pkgs, + system, + ... + }: + let + nixvimLib = nixvim.lib.${system}; + nixvimPkgs = nixvim.legacyPackages.${system}; + nixvimModule = { + inherit pkgs; + module = import ./config; # import the module directly + # You can use `extraSpecialArgs` to pass additional arguments to your module files + extraSpecialArgs = { + # inherit (inputs) foo; + }; + }; + nvim = nixvimPkgs.makeNixvimWithModule nixvimModule; + in + { + checks = { + # Run `nix flake check .` to verify that your config is not broken + default = nixvimLib.check.mkTestDerivationFromNixvimModule nixvimModule; + }; - pkgs = import nixpkgs { - inherit system; - overlays = [ - overlayFlakeInputs - overlayLazyVim - ]; + packages = { + # Lets you run `nix run .` to start nixvim + default = nvim; + }; }; - in - rec { - packages.lazyVim = pkgs.lazyVim; - apps.lazyVim = { - type = "app"; - program = "${packages.default}/bin/nvim"; - }; - packages.default = packages.lazyVim; - apps.default = apps.lazyVim; - } - ); + }; } diff --git a/packages/lazyVim.nix b/packages/lazyVim.nix deleted file mode 100644 index fffb812..0000000 --- a/packages/lazyVim.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ pkgs }: -let - config = import ../config { inherit pkgs; }; - runtimeDeps = import ../runtimeDeps.nix { inherit pkgs; }; -in -pkgs.wrapNeovim pkgs.neovim { - viAlias = true; - vimAlias = true; - withNodeJs = true; - withPython3 = true; - withRuby = false; - extraMakeWrapperArgs = ''--prefix PATH : "${pkgs.lib.makeBinPath runtimeDeps.dependencies}" --set XDG_CONFIG_HOME "${config}"''; -} diff --git a/renovate.json5 b/renovate.json5 deleted file mode 100644 index b1abcf2..0000000 --- a/renovate.json5 +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["local>local/renovate"], - "nix": { - "enabled": true - } -} diff --git a/runtimeDeps.nix b/runtimeDeps.nix deleted file mode 100644 index 51b9bfd..0000000 --- a/runtimeDeps.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ pkgs }: -{ - dependencies = - with pkgs; - [ - nixfmt-rfc-style # nix formatter - (terraform.overrideAttrs (oldAttrs: { - meta.license = lib.licenses.mpl20; - })) # terraform fmt - ripgrep - fd - git - curl # needed to fetch titles from urls - wget - cargo - php82 - php82Packages.composer - go - ruby - luarocks - zulu # java11 - fish - fzf - perl540 - perl540Packages.CPAN - unzip - tree-sitter - gnumake - lazygit - python312 - python312Packages.pip - ] - ++ (if pkgs.stdenv.hostPlatform.isDarwin then [ ] else [ gcc ]); -}