diff --git a/flake.lock b/flake.lock index 7bd0067..ba6e464 100644 --- a/flake.lock +++ b/flake.lock @@ -19,45 +19,6 @@ "type": "github" } }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1756770412, - "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "4524271976b625a4a605beefd893f270620fd751", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -79,34 +40,6 @@ "type": "github" } }, - "ixx": { - "inputs": { - "flake-utils": [ - "nixvim", - "nuschtosSearch", - "flake-utils" - ], - "nixpkgs": [ - "nixvim", - "nuschtosSearch", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1754860581, - "narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=", - "owner": "NuschtOS", - "repo": "ixx", - "rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "ref": "v0.1.1", - "repo": "ixx", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1759381078, @@ -171,53 +104,6 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": [ - "nixpkgs" - ], - "nuschtosSearch": "nuschtosSearch", - "systems": "systems_2" - }, - "locked": { - "lastModified": 1758373036, - "narHash": "sha256-tm73KNHsGQwAAoFEcAvuXAmHf3KaWLSuf/R9UQ6WMnU=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "a30decbd5fc231e84dfefeb75bc7f57d8167726c", - "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": 1758272005, - "narHash": "sha256-1u3xTH+3kaHhztPmWtLAD8LF5pTYLR2CpsPFWTFnVtQ=", - "owner": "NuschtOS", - "repo": "search", - "rev": "aa975a3757f28ce862812466c5848787b868e116", - "type": "github" - }, - "original": { - "owner": "NuschtOS", - "repo": "search", - "type": "github" - } - }, "nvim-treesitter": { "flake": false, "locked": { @@ -277,41 +163,10 @@ "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", "nixpkgs": "nixpkgs_2", - "nixvim": "nixvim", "nvim-treesitter-main": "nvim-treesitter-main", "vim-org-roam": "vim-org-roam" } }, - "systems": { - "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, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "vim-org-roam": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index dc80f88..ba8d6c7 100644 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; emacs-overlay.url = "github:nix-community/emacs-overlay"; - nixvim = { - url = "github:nix-community/nixvim/nixos-25.05"; - inputs.nixpkgs.follows = "nixpkgs"; - }; vim-org-roam = { url = "github:chipsenkbeil/org-roam.nvim"; flake = false; diff --git a/modules/editor/vim/vim.nix b/modules/editor/vim/vim.nix index 58178db..a502675 100644 --- a/modules/editor/vim/vim.nix +++ b/modules/editor/vim/vim.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - inputs, ... }: @@ -16,7 +15,6 @@ in config = lib.mkIf cfg.enable { home-manager.users.${config.user.name} = { - imports = [ inputs.nixvim.homeModules.nixvim ]; programs.neovim = { enable = true; @@ -271,229 +269,6 @@ in source = ./lua; }; - programs.nixvim = { - enable = false; - package = pkgs.neovim-unwrapped; - vimAlias = true; - - keymaps = [ - # Search - { - key = "cx"; - action = "Telescope diagnostics layout_strategy=vertical"; - options.desc = "Search diagnostics"; - } - # Project - { - key = "ps"; - action = "wa"; - options.desc = "Save all buffers"; - } - ]; - - plugins = { - lazy = { - enable = true; - plugins = [ - { - pkg = pkgs.vimPlugins.gitsigns-nvim; - opts.__raw = # lua - '' - { - on_attach = function(buffer) - local gs = package.loaded.gitsigns - - local function map(mode, l ,r, desc) - vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc}) - end - - map("n", "g;", function() - if vim.wo.diff then - vim.cmd.normal({ "]c", bang = true }) - else - gs.nav_hunk("next") - end - end, "Next Hunk") - map("n", "g,", function() - if vim.wo.diff then - vim.cmd.normal({ "[c", bang = true }) - else - gs.nav_hunk("prev") - end - end, "Prev Hunk") - map({ "n", "v" }, "gs", gs.stage_hunk, "Stage Hunk") - map({ "n", "v" }, "gr", gs.reset_hunk, "Reset Hunk") - map("n", "gS", gs.stage_buffer, "Stage Buffer") - map("n", "gu", gs.undo_stage_hunk, "Undo Stage Hunk") - map("n", "gR", gs.reset_buffer, "Reset Buffer") - map("n", "gp", gs.preview_hunk_inline, "Preview Hunk Inline") - map("n", "gb", function() gs.blame_line({ full = true }) end, "Blame Line") - map("n", "gd", gs.diffthis, "Diff This") - map("n", "gD", function() gs.diffthis("~") end, "Diff This ~") - map('n', 'tb', gs.toggle_current_line_blame, "Toggle current line blame") - map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") - end, - } - ''; - } - { - pkg = pkgs.vimPlugins.which-key-nvim; - event = "VimEnter"; - config = # lua - '' - function () - require('which-key').setup() - require('which-key').register { - ['b'] = { name = 'Buffer', _ = 'which_key_ignore' }, - ['c'] = { name = 'Code', _ = 'which_key_ignore' }, - ['d'] = { name = 'Document', _ = 'which_key_ignore' }, - ['f'] = { name = 'File', _ = 'which_key_ignore' }, - ['g'] = { name = 'Git', _ = 'which_key_ignore' }, - ['o'] = { name = 'Org', _ = 'which_key_ignore' }, - ['n'] = { name = 'Org-roam', _ = 'which_key_ignore' }, - ['p'] = { name = 'Project', _ = 'which_key_ignore' }, - ['r'] = { name = 'Rename', _ = 'which_key_ignore' }, - ['s'] = { name = 'Search', _ = 'which_key_ignore' }, - ['w'] = { name = 'Window', _ = 'which_key_ignore' }, - ['t'] = { name = 'Toggle', _ = 'which_key_ignore' }, - ['q'] = { name = 'Quit/Session', _ = 'which_key_ignore' }, - } - end - ''; - } - { - pkg = pkgs.vimPlugins.nvim-lspconfig; - config = # lua - '' - function () - vim.api.nvim_create_autocmd('LspAttach', { - group = vim.api.nvim_create_augroup('lsp-attach', { clear = true }), - callback = function(event) - local map = function(keys, func, desc) - vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) - end - - map('gd', require('telescope.builtin').lsp_definitions, 'Go to definition') - map('gr', require('telescope.builtin').lsp_references, 'Go to references') - map('gI', require('telescope.builtin').lsp_implementations, 'Goto implementation') - map('gD', vim.lsp.buf.declaration, 'Go to declaration') - map('gT', require('telescope.builtin').lsp_type_definitions, 'Type definition') - map('cD', require('telescope.builtin').lsp_document_symbols, 'Document symbols') - map('cw', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Workspace symbols ') - map('cd', vim.diagnostic.open_float, 'Line diagnostics') - map('c,', vim.diagnostic.goto_prev, 'Previous diagnostics') - map('c;', vim.diagnostic.goto_next, 'Next diagnostics') - map('cr', vim.lsp.buf.rename, 'Rename') - map('ca', vim.lsp.buf.code_action, 'Code action') - map('K', vim.lsp.buf.hover, 'Hover Documentation') - end - }) - - local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") - local capabilities = vim.tbl_deep_extend( - "force", - {}, - vim.lsp.protocol.make_client_capabilities(), - has_cmp and cmp_nvim_lsp.default_capabilities() or {} - ) - - local function setup(server, server_opts) - local server_opts_with_caps = vim.tbl_deep_extend("force", { - capabilities = vim.deepcopy(capabilities), - }, server_opts) - - require("lspconfig")[server].setup(server_opts_with_caps) - end - - setup("yamlls", {}) - setup("typos_lsp", { - init_options = { diagnosticSeverity = "Hint" } - }) - setup("tsserver", {}) - setup("terraformls", {}) - setup("marksman", {}) - setup("lua_ls", {}) - setup("jsonls", { cmd = { "${pkgs.vscode-langservers-extracted}/bin/vscode-json-language-server", "--stdio" } }) - setup("html", { cmd = { "${pkgs.vscode-langservers-extracted}/bin/vscode-html-language-server", "--stdio" } }) - setup("eslint", { cmd = { "${pkgs.vscode-langservers-extracted}/bin/vscode-eslint-language-server", "--stdio" } }) - setup("dockerls", { cmd = { "${pkgs.dockerfile-language-server-nodejs}/bin/docker-langserver", "--stdio" } }) - setup("docker_compose_language_service", {}) - setup("cssls", { cmd = { "${pkgs.vscode-langservers-extracted}/bin/vscode-css-language-server", "--stdio" } }) - setup("bashls", {}) - setup("ansiblels", { cmd = { "${pkgs.ansible-language-server}/bin/ansible-language-server", "--stdio" } }) - end - ''; - } - { - pkg = pkgs.vimPlugins.nvim-cmp; - event = "InsertEnter"; - dependencies = [ - pkgs.vimPlugins.cmp-nvim-lsp - pkgs.vimPlugins.cmp-path - pkgs.vimPlugins.cmp-buffer - ]; - opts.__raw = # lua - '' - function() - local cmp = require("cmp") - return { - mapping = { - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping(cmp.mapping.select_prev_item(), { "i", "s" }), - [""] = cmp.mapping(cmp.mapping.select_next_item(), { "i", "s" }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "path" }, - { name = "buffer" }, - { name = "orgmode" }, - }, - } - end - ''; - } - - # Disabled for now as it tries to write org grammar to its own directory in the nix store - # https://github.com/nvim-orgmode/orgmode/blob/95fb795a422f0455e03d13a3f83525f1d00793ad/lua/orgmode/utils/treesitter/install.lua#L9 - # { - # pkg = pkgs.vimPlugins.orgmode; - # event = "VeryLazy"; - # ft = [ "org" ]; - # config = /*lua*/ '' - # function () - # require('orgmode').setup({ - # org_agend_files = '~/Nextcloud/Org/**/*', - # org_default_notes_file = '~/Nextcloud/Org/refile.org', - # }) - # end - # ''; - # } - # { - # pkg = (pkgs.vimUtils.buildVimPlugin { - # name = "org-roam.nvim"; - # src = inputs.vim-org-roam; - # }); - # dependencies = [ pkgs.vimPlugins.orgmode ]; - # event = "VeryLazy"; - # ft = [ "org" ]; - # config = /*lua*/ '' - # function () - # require('org-roam').setup({ - # directory = '~/Nextcloud/OrgRoam', - # }) - # end - # ''; - # } - ]; - }; - }; - }; - home.packages = with pkgs; [ ripgrep fd