From adb2cbc4cab6cc5551bec844b3963e82840d9128 Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sun, 16 Mar 2025 14:10:17 +0000 Subject: [PATCH] neovim: move from module to user config --- hosts/atlas/default.nix | 1 - hosts/eos/default.nix | 1 - hosts/helios/default.nix | 1 - hosts/hypnos/default.nix | 1 - hosts/odyssey/default.nix | 1 - modules/home-manager/default.nix | 1 - modules/home-manager/programs/neovim.nix | 146 ----------------------- users/jordan/default.nix | 1 + users/jordan/neovim.nix | 132 ++++++++++++++++++++ 9 files changed, 133 insertions(+), 152 deletions(-) delete mode 100644 modules/home-manager/programs/neovim.nix create mode 100644 users/jordan/neovim.nix diff --git a/hosts/atlas/default.nix b/hosts/atlas/default.nix index 7b88e0d..6e35213 100644 --- a/hosts/atlas/default.nix +++ b/hosts/atlas/default.nix @@ -29,7 +29,6 @@ vector.enable = true; }; libreoffice.enable = true; - neovim.enable = true; pass.enable = true; qbittorrent.enable = true; thunderbird.enable = true; diff --git a/hosts/eos/default.nix b/hosts/eos/default.nix index 3c1d797..3ff5e3f 100644 --- a/hosts/eos/default.nix +++ b/hosts/eos/default.nix @@ -27,7 +27,6 @@ modules = { programs = { firefox.enable = true; - neovim.enable = true; pass.enable = true; qbittorrent.enable = true; }; diff --git a/hosts/helios/default.nix b/hosts/helios/default.nix index bb169fb..f597e23 100644 --- a/hosts/helios/default.nix +++ b/hosts/helios/default.nix @@ -28,7 +28,6 @@ modules = { programs = { firefox.enable = true; - neovim.enable = true; pass.enable = true; qbittorrent.enable = true; }; diff --git a/hosts/hypnos/default.nix b/hosts/hypnos/default.nix index a6c9dcb..86cded5 100644 --- a/hosts/hypnos/default.nix +++ b/hosts/hypnos/default.nix @@ -51,7 +51,6 @@ modules = { programs = { firefox.enable = true; - neovim.enable = true; pass.enable = true; recording = { audio.enable = true; diff --git a/hosts/odyssey/default.nix b/hosts/odyssey/default.nix index a63a820..31597d9 100644 --- a/hosts/odyssey/default.nix +++ b/hosts/odyssey/default.nix @@ -70,7 +70,6 @@ libreoffice.enable = true; lutris.enable = true; pass.enable = true; - neovim.enable = true; qbittorrent.enable = true; recording = { audio.enable = true; diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 40a7863..e3518ce 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -8,7 +8,6 @@ ./programs/graphics.nix ./programs/libreoffice.nix ./programs/lutris.nix - ./programs/neovim.nix ./programs/pass.nix ./programs/qbittorrent.nix ./programs/recording.nix diff --git a/modules/home-manager/programs/neovim.nix b/modules/home-manager/programs/neovim.nix deleted file mode 100644 index 141035c..0000000 --- a/modules/home-manager/programs/neovim.nix +++ /dev/null @@ -1,146 +0,0 @@ -{ - config, - lib, - ... -}: - -let - cfg = config.modules.programs.neovim; -in -{ - options.modules.programs.neovim = { - enable = lib.mkOption { - default = false; - example = true; - }; - }; - - config = lib.mkIf cfg.enable { - home.programs.nixvim.config = { - enable = true; - defaultEditor = true; - - viAlias = true; - vimAlias = true; - - options = { - number = true; - tabstop = 2; - shiftwidth = 2; - expandtab = true; - foldlevel = 99; - splitbelow = true; - splitright = true; - undofile = true; - updatetime = 100; - list = true; - }; - - globals = { - mapleader = ","; - maplocalleader = ","; - }; - - clipboard = { - register = "unnamedplus"; - - providers.wl-copy.enable = true; - }; - - plugins.comment.enable = true; - - plugins.hmts.enable = true; - - plugins.lightline.enable = true; - - plugins.luasnip.enable = true; - - plugins.lsp = { - enable = true; - servers = { - bashls.enable = true; - ccls.enable = true; - cssls.enable = true; - eslint.enable = true; - gopls.enable = true; - html.enable = true; - lua_ls.enable = true; - pylsp.enable = true; - nixd.enable = true; - rust_analyzer = { - enable = true; - installCargo = true; - installRustc = true; - }; - ts_ls.enable = true; - }; - }; - - plugins.nvim-autopairs.enable = true; - - plugins.cmp = { - enable = true; - autoEnableSources = true; - settings = { - sources = [ - { name = "nvim_lsp"; } - { name = "path"; } - { name = "buffer"; } - ]; - mapping = { - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - "" = "cmp.mapping.confirm({ select = true })"; - }; - }; - }; - - plugins.telescope = { - enable = true; - keymaps = { - "ff" = "find_files"; - "fg" = "live_grep"; - "b" = "buffers"; - "fh" = "help_tags"; - "" = "git_files"; - "" = "live_grep"; - }; - }; - - plugins.treesitter = { - enable = true; - - nixvimInjections = true; - - folding = true; - settings.indent.enable = true; - }; - - plugins.treesitter-refactor = { - enable = true; - highlightDefinitions = { - enable = true; - clearOnCursorMove = false; - }; - }; - - plugins.undotree.enable = true; - - plugins.web-devicons.enable = true; - - # plugins.gitsigns.enable = true; - # plugins.gitgutter.enable = true; - # plugins.goyo.enable = true; - # plugins.fugitive.enable = true; - # plugins.fzf-lua.enable = true; - # plugins.neo-tree.enable = true; - # plugins.none-ls.enable = true; - # plugins.nvim-tree.enable = true; - # plugins.oil.enable = true; - # plugins.project-nvim.enable = true; - # plugins.surround.enable = true; - }; - - env.EDITOR = "nvim"; - }; -} diff --git a/users/jordan/default.nix b/users/jordan/default.nix index 9fb8537..6a77695 100644 --- a/users/jordan/default.nix +++ b/users/jordan/default.nix @@ -33,6 +33,7 @@ in imports = [ ./git.nix ./gpg.nix + ./neovim.nix ./shell.nix ]; diff --git a/users/jordan/neovim.nix b/users/jordan/neovim.nix new file mode 100644 index 0000000..4a8022e --- /dev/null +++ b/users/jordan/neovim.nix @@ -0,0 +1,132 @@ +{ + ... +}: + +{ + home.programs.nixvim.config = { + enable = true; + defaultEditor = true; + + viAlias = true; + vimAlias = true; + + options = { + number = true; + tabstop = 2; + shiftwidth = 2; + expandtab = true; + foldlevel = 99; + splitbelow = true; + splitright = true; + undofile = true; + updatetime = 100; + list = true; + }; + + globals = { + mapleader = ","; + maplocalleader = ","; + }; + + clipboard = { + register = "unnamedplus"; + + providers.wl-copy.enable = true; + }; + + plugins.comment.enable = true; + + plugins.hmts.enable = true; + + plugins.lightline.enable = true; + + plugins.luasnip.enable = true; + + plugins.lsp = { + enable = true; + servers = { + bashls.enable = true; + ccls.enable = true; + cssls.enable = true; + eslint.enable = true; + gopls.enable = true; + html.enable = true; + lua_ls.enable = true; + pylsp.enable = true; + nixd.enable = true; + rust_analyzer = { + enable = true; + installCargo = true; + installRustc = true; + }; + ts_ls.enable = true; + }; + }; + + plugins.nvim-autopairs.enable = true; + + plugins.cmp = { + enable = true; + autoEnableSources = true; + settings = { + sources = [ + { name = "nvim_lsp"; } + { name = "path"; } + { name = "buffer"; } + ]; + mapping = { + "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; + "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; + "" = "cmp.mapping.confirm({ select = true })"; + }; + }; + }; + + plugins.telescope = { + enable = true; + keymaps = { + "ff" = "find_files"; + "fg" = "live_grep"; + "b" = "buffers"; + "fh" = "help_tags"; + "" = "git_files"; + "" = "live_grep"; + }; + }; + + plugins.treesitter = { + enable = true; + + nixvimInjections = true; + + folding = true; + settings.indent.enable = true; + }; + + plugins.treesitter-refactor = { + enable = true; + highlightDefinitions = { + enable = true; + clearOnCursorMove = false; + }; + }; + + plugins.undotree.enable = true; + + plugins.web-devicons.enable = true; + + # plugins.gitsigns.enable = true; + # plugins.gitgutter.enable = true; + # plugins.goyo.enable = true; + # plugins.fugitive.enable = true; + # plugins.fzf-lua.enable = true; + # plugins.neo-tree.enable = true; + # plugins.none-ls.enable = true; + # plugins.nvim-tree.enable = true; + # plugins.oil.enable = true; + # plugins.project-nvim.enable = true; + # plugins.surround.enable = true; + }; + + home.sessionVariables.EDITOR = "nvim"; +}