diff --git a/flake.nix b/flake.nix index 875fa432..4e417e7f 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ ./flake/legacyPackages.nix ./flake/overlays.nix ./flake/packages.nix + ./flake/develop.nix ]; flake = { @@ -56,20 +57,7 @@ }; }; - perSystem = { - self', - config, - pkgs, - ... - }: { - devShells = { - default = self'.devShells.lsp; - nvim-nix = pkgs.mkShell {packages = [config.packages.nix];}; - lsp = pkgs.mkShell { - packages = with pkgs; [nil statix deadnix alejandra]; - }; - }; - + perSystem = {pkgs, ...}: { # Provide the default formatter. `nix fmt` in project root # will format available files with the correct formatter. # P.S: Please do not format with nixfmt! It messes with many diff --git a/flake/develop.nix b/flake/develop.nix new file mode 100644 index 00000000..7b645288 --- /dev/null +++ b/flake/develop.nix @@ -0,0 +1,30 @@ +{lib, ...}: { + perSystem = { + pkgs, + config, + self', + ... + }: { + devShells = { + default = self'.devShells.lsp; + nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];}; + lsp = pkgs.mkShellNoCC { + packages = with pkgs; [nil statix deadnix alejandra]; + }; + }; + + # This package exists to make development easier by providing the place and + # boilerplate to build a test nvf configuration. Feel free to use this for + # testing, but make sure to discard the changes before creating a pull + # request. + packages.dev = let + configuration = {}; + + customNeovim = lib.nvim.neovimConfiguration { + inherit pkgs; + modules = [configuration]; + }; + in + customNeovim.neovim; + }; +} diff --git a/modules/plugins/completion/nvim-cmp/config.nix b/modules/plugins/completion/nvim-cmp/config.nix index b50d7266..cfd3e53a 100644 --- a/modules/plugins/completion/nvim-cmp/config.nix +++ b/modules/plugins/completion/nvim-cmp/config.nix @@ -10,6 +10,8 @@ inherit (lib.nvim.attrsets) mapListToAttrs; inherit (builtins) attrNames typeOf tryEval concatStringsSep; + borders = config.vim.ui.borders.plugins.nvim-cmp; + cfg = config.vim.autocomplete.nvim-cmp; luasnipEnable = config.vim.snippets.luasnip.enable; getPluginName = plugin: @@ -81,10 +83,9 @@ in { setupOpts = { sources = map (s: {name = s;}) (attrNames cfg.sources); - # TODO: try to get nvim-cmp to follow global border style - window = mkIf config.vim.ui.borders.enable { - completion = mkLuaInline "cmp.config.window.bordered()"; - documentation = mkLuaInline "cmp.config.window.bordered()"; + window = mkIf borders.enable { + completion.border = borders.style; + documentation.border = borders.style; }; formatting.format = cfg.format; diff --git a/modules/plugins/completion/nvim-cmp/nvim-cmp.nix b/modules/plugins/completion/nvim-cmp/nvim-cmp.nix index d63ed732..06282b6e 100644 --- a/modules/plugins/completion/nvim-cmp/nvim-cmp.nix +++ b/modules/plugins/completion/nvim-cmp/nvim-cmp.nix @@ -72,7 +72,7 @@ in { }; format = mkOption { - type = luaInline; + type = nullOr luaInline; default = mkLuaInline '' function(entry, vim_item) vim_item.menu = (${toLuaObject cfg.sources})[entry.source.name]