From 355d99ed2b3af73a868a33e71acf73cb984ae7d5 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 10 Feb 2024 18:19:26 +0530 Subject: [PATCH] enable neovim with home-manager options --- flake.lock | 170 +---------------------- flake.nix | 10 -- home/programs/default.nix | 2 +- home/programs/neovim.nix | 230 ------------------------------- home/programs/neovim/default.nix | 18 +++ 5 files changed, 20 insertions(+), 410 deletions(-) delete mode 100644 home/programs/neovim.nix create mode 100644 home/programs/neovim/default.nix diff --git a/flake.lock b/flake.lock index 5ab74b2..84e9079 100644 --- a/flake.lock +++ b/flake.lock @@ -37,22 +37,6 @@ "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": [ @@ -74,27 +58,6 @@ "type": "github" } }, - "flake-parts_2": { - "inputs": { - "nixpkgs-lib": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1706830856, - "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -113,24 +76,6 @@ "type": "github" } }, - "flake-utils_2": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ @@ -153,28 +98,6 @@ "type": "github" } }, - "gitignore_2": { - "inputs": { - "nixpkgs": [ - "nixvim", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -238,27 +161,6 @@ "type": "github" } }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1706833576, - "narHash": "sha256-w7BL0EWRts+nD1lbLECIuz6fRzmmV+z8oWwoY7womR0=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "bdbae6ecff8fcc322bf6b9053c0b984912378af7", - "type": "github" - }, - "original": { - "owner": "lnl7", - "repo": "nix-darwin", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1707268954, @@ -291,60 +193,6 @@ "type": "github" } }, - "nixvim": { - "inputs": { - "flake-parts": "flake-parts_2", - "home-manager": [ - "home-manager" - ], - "nix-darwin": "nix-darwin", - "nixpkgs": [ - "nixpkgs" - ], - "pre-commit-hooks": "pre-commit-hooks" - }, - "locked": { - "lastModified": 1707516359, - "narHash": "sha256-uDIEvKg0LOozL93UluLu0atEtP711E84+WVXsIfJ+LE=", - "owner": "nix-community", - "repo": "nixvim", - "rev": "92c623a436604b548b295536ba8888dd5e184a84", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixvim", - "type": "github" - } - }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", - "gitignore": "gitignore_2", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1706424699, - "narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -382,8 +230,7 @@ "home-manager": "home-manager", "impermanence": "impermanence", "lanzaboote": "lanzaboote", - "nixpkgs": "nixpkgs", - "nixvim": "nixvim" + "nixpkgs": "nixpkgs" } }, "rust-overlay": { @@ -425,21 +272,6 @@ "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" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index a3fdc3f..a86ed6c 100644 --- a/flake.nix +++ b/flake.nix @@ -26,14 +26,6 @@ nixpkgs.follows = "nixpkgs"; }; }; - - nixvim = { - url = "github:nix-community/nixvim"; - inputs = { - home-manager.follows = "home-manager"; - nixpkgs.follows = "nixpkgs"; - }; - }; }; outputs = @@ -43,7 +35,6 @@ , home-manager , impermanence , lanzaboote - , nixvim , } @ inputs: let @@ -82,7 +73,6 @@ users.${secrets.users.primary.userName} = { pkgs, ... }: { imports = [ impermanence.nixosModules.home-manager.impermanence - nixvim.homeManagerModules.nixvim ./home ]; }; diff --git a/home/programs/default.nix b/home/programs/default.nix index e3930d1..01bc5d3 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -11,7 +11,7 @@ ./gnupg.nix ./kitty.nix ./mpv.nix - ./neovim.nix + ./neovim ./ssh.nix ./starship.nix ./tmux.nix diff --git a/home/programs/neovim.nix b/home/programs/neovim.nix deleted file mode 100644 index ca805b8..0000000 --- a/home/programs/neovim.nix +++ /dev/null @@ -1,230 +0,0 @@ -{ pkgs, ... }: { - xdg.desktopEntries = { - "nvim".name = "Neovim wrapper"; - "nvim".exec = "nvim %F"; - "nvim".noDisplay = true; - }; - programs.nixvim = { - enable = true; - viAlias = true; - vimAlias = true; - clipboard.providers.wl-copy.enable = true; - colorschemes.dracula = { - enable = true; - fullSpecialAttrsSupport = true; - }; - extraPackages = with pkgs; [ - fd - ripgrep - ]; - extraConfigLuaPre = '' - vim.opt.listchars:append "space:⋅" - vim.opt.listchars:append "eol:↴" - ''; - options = { - autowrite = true; - background = "dark"; - clipboard = "unnamedplus"; - expandtab = true; - laststatus = 2; - list = true; - number = true; - relativenumber = true; - shiftwidth = 2; - showmode = false; - signcolumn = "yes"; - smartindent = true; - splitbelow = true; - splitright = true; - swapfile = false; - tabstop = 2; - termguicolors = true; - updatetime = 100; - wrap = true; - }; - keymaps = [ - { - mode = "n"; - key = ""; - options.silent = true; - action = "bp"; - } - { - mode = "n"; - key = ""; - options.silent = true; - action = "bn"; - } - { - mode = "n"; - key = ""; - options.silent = true; - action = "noh"; - } - { - mode = "n"; - key = "w"; - options.silent = true; - action = "bdeletebnext"; - } - { - mode = "n"; - key = "`"; - options.silent = true; - action = ":ToggleTerm"; - } - { - mode = "n"; - key = "1"; - options.silent = true; - action = ":Neotree toggle"; - } - { - mode = "n"; - key = "ff"; - options.silent = true; - action = ":Telescope find_files"; - } - { - mode = "n"; - key = "fg"; - options.silent = true; - action = ":Telescope live_grep"; - } - { - mode = "n"; - key = "pp"; - options.silent = true; - action = ":MarkdownPreview"; - } - { - mode = "n"; - key = "po"; - options.silent = true; - action = ":MarkdownPreviewStop"; - } - ]; - plugins = { - bufferline = { - enable = true; - diagnostics = "nvim_lsp"; - offsets = [ - { - filetype = "neo-tree"; - text = "File Explorer"; - separator = true; - } - ]; - separatorStyle = "slant"; - }; - cmp-buffer.enable = true; - cmp-nvim-lsp.enable = true; - cmp-nvim-lsp-document-symbol.enable = true; - cmp-nvim-lsp-signature-help.enable = true; - cmp-treesitter.enable = true; - cmp_luasnip.enable = true; - gitblame = { - enable = true; - dateFormat = "%r"; - }; - gitsigns.enable = true; - indent-blankline.enable = true; - lastplace.enable = true; - lsp = { - enable = true; - servers = { - bashls.enable = true; - dartls = { - enable = true; - installLanguageServer = false; - }; - eslint = { - enable = true; - installLanguageServer = false; - }; - gopls = { - enable = true; - installLanguageServer = false; - }; - hls = { - enable = true; - installLanguageServer = false; - }; - html = { - enable = true; - installLanguageServer = false; - }; - jsonls.enable = true; - nixd.enable = true; - pyright = { - enable = true; - installLanguageServer = false; - }; - rust-analyzer = { - enable = true; - installCargo = false; - installRustc = false; - }; - yamlls.enable = true; - }; - }; - lsp-lines.enable = true; - lualine = { - enable = true; - globalstatus = true; - theme = "dracula"; - }; - markdown-preview = { - enable = true; - browser = "${pkgs.ungoogled-chromium}/bin/chromium"; - theme = "light"; - }; - neo-tree = { - enable = true; - addBlankLineAtTop = true; - enableDiagnostics = true; - enableGitStatus = true; - closeIfLastWindow = false; - filesystem = { - followCurrentFile = { - enabled = true; - leaveDirsOpen = false; - }; - filteredItems.visible = true; - useLibuvFileWatcher = true; - }; - }; - nvim-cmp = { - enable = true; - snippet.expand = "luasnip"; - sources = [ - { name = "nvim_lsp"; } - { name = "luasnip"; } - { name = "buffers"; } - { name = "treesitter"; } - ]; - }; - telescope = { - enable = true; - extensions = { - fzf-native = { - enable = true; - caseMode = "smart_case"; - fuzzy = true; - }; - }; - }; - toggleterm = { - enable = true; - }; - treesitter = { - enable = true; - }; - treesitter-refactor = { - enable = true; - highlightDefinitions.enable = true; - navigation.enable = true; - }; - }; - }; -} diff --git a/home/programs/neovim/default.nix b/home/programs/neovim/default.nix new file mode 100644 index 0000000..f304373 --- /dev/null +++ b/home/programs/neovim/default.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: { + xdg = { + desktopEntries = { + "nvim".name = "Neovim wrapper"; + "nvim".exec = "nvim %F"; + "nvim".noDisplay = true; + }; + }; + programs.neovim = { + enable = true; + withNodeJs = true; + withPython3 = true; + withRuby = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; +}