diff --git a/flake.nix b/flake.nix index 355436d6..3d35fdf3 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,12 @@ }; inherit (pkgs) mkShell; + + neovimWithConfig = inputs.nixvim.legacyPackages.${system}.makeNixvimWithModule { + inherit pkgs; + + module = import ./modules/home-manager/coding/neovim/nixvim.nix; + }; in { devShells.${system}.default = pkgs.mkShell { @@ -55,6 +61,8 @@ packages.${system} = { default = mkShell { buildInputs = with pkgs; [ just ]; }; + + nvim = neovimWithConfig; }; formatter.${system} = pkgs.nixfmt-rfc-style; diff --git a/modules/home-manager/coding/neovim/default.nix b/modules/home-manager/coding/neovim/default.nix index b5ba2efe..7b9d00b4 100644 --- a/modules/home-manager/coding/neovim/default.nix +++ b/modules/home-manager/coding/neovim/default.nix @@ -2,7 +2,6 @@ config, inputs, lib, - pkgs, ... }: @@ -22,67 +21,10 @@ in programs.nixvim = { enable = true; - # TODO: re-add DAP. - # TODO: re-add snippets. - # TODO: re-configure spell. - viAlias = true; vimAlias = true; - imports = [ - ./keymaps.nix - ./options.nix - ./plugins/cmp.nix - ./plugins/conform.nix - ./plugins/fidget.nix - ./plugins/fugitive.nix - ./plugins/gitsigns.nix - ./plugins/harpoon.nix - ./plugins/lint.nix - ./plugins/lsp.nix - ./plugins/lualine.nix - ./plugins/luasnip.nix - ./plugins/mini.nix - ./plugins/nvim-autopairs.nix - ./plugins/oil.nix - ./plugins/phpactor.nix - ./plugins/refactoring.nix - ./plugins/telescope.nix - ./plugins/treesitter.nix - ./plugins/undotree.nix - ./plugins/vim-dadbod.nix - ./plugins/vim-highlightedyank.nix - ./plugins/vim-test.nix - ./plugins/web-devicons.nix - ]; - - colorschemes.catppuccin = { - enable = true; - settings.flavour = "mocha"; - }; - - extraPackages = with pkgs; [ - nixfmt-rfc-style - stylua - ]; - - filetype = { - extension = { - "neon.dist" = "yaml"; - inc = "php"; - install = "php"; - module = "php"; - neon = "yaml"; - pcss = "scss"; - theme = "php"; - }; - - filename = { - "composer.lock" = "json"; - }; - }; - - globals.mapleader = " "; + imports = [ ./nixvim.nix ]; }; }; } diff --git a/modules/home-manager/coding/neovim/nixvim.nix b/modules/home-manager/coding/neovim/nixvim.nix new file mode 100644 index 00000000..b77cabcb --- /dev/null +++ b/modules/home-manager/coding/neovim/nixvim.nix @@ -0,0 +1,62 @@ +{ pkgs, ... }: + +{ + # TODO: re-add DAP. + # TODO: re-add snippets. + # TODO: re-configure spell. + + imports = [ + ./keymaps.nix + ./options.nix + ./plugins/cmp.nix + ./plugins/conform.nix + ./plugins/fidget.nix + ./plugins/fugitive.nix + ./plugins/gitsigns.nix + ./plugins/harpoon.nix + ./plugins/lint.nix + ./plugins/lsp.nix + ./plugins/lualine.nix + ./plugins/luasnip.nix + ./plugins/mini.nix + ./plugins/nvim-autopairs.nix + ./plugins/oil.nix + ./plugins/phpactor.nix + ./plugins/refactoring.nix + ./plugins/telescope.nix + ./plugins/treesitter.nix + ./plugins/undotree.nix + ./plugins/vim-dadbod.nix + ./plugins/vim-highlightedyank.nix + ./plugins/vim-test.nix + ./plugins/web-devicons.nix + ]; + + colorschemes.catppuccin = { + enable = true; + settings.flavour = "mocha"; + }; + + extraPackages = with pkgs; [ + nixfmt-rfc-style + stylua + ]; + + filetype = { + extension = { + "neon.dist" = "yaml"; + inc = "php"; + install = "php"; + module = "php"; + neon = "yaml"; + pcss = "scss"; + theme = "php"; + }; + + filename = { + "composer.lock" = "json"; + }; + }; + + globals.mapleader = " "; +}