From 4e8ec4cd5b5fd83358ef5635b73a07037f25cd66 Mon Sep 17 00:00:00 2001 From: Frothy <76622149+FrothyMarrow@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:39:43 -0500 Subject: [PATCH 1/4] utility/telescope: provide configurable vimgrep options --- modules/utility/telescope/config.nix | 15 +++------------ modules/utility/telescope/telescope.nix | 24 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/modules/utility/telescope/config.nix b/modules/utility/telescope/config.nix index 53cde96..2431423 100644 --- a/modules/utility/telescope/config.nix +++ b/modules/utility/telescope/config.nix @@ -5,9 +5,10 @@ ... }: let inherit (lib) addDescriptionsToMappings mkIf mkMerge mkSetBinding nvim; + inherit (nvim.lua) listToLuaTable; cfg = config.vim.telescope; - self = import ./telescope.nix {inherit lib;}; + self = import ./telescope.nix {inherit pkgs lib;}; mappingDefinitions = self.options.vim.telescope.mappings; mappings = addDescriptionsToMappings cfg.mappings mappingDefinitions; @@ -56,17 +57,7 @@ in { local telescope = require('telescope') telescope.setup { defaults = { - vimgrep_arguments = { - "${pkgs.ripgrep}/bin/rg", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - "--hidden", - "--no-ignore", - }, + vimgrep_arguments = ${listToLuaTable cfg.vimgrep_arguments}, pickers = { find_command = { "${pkgs.fd}/bin/fd", diff --git a/modules/utility/telescope/telescope.nix b/modules/utility/telescope/telescope.nix index 12ea887..9cfd092 100644 --- a/modules/utility/telescope/telescope.nix +++ b/modules/utility/telescope/telescope.nix @@ -1,5 +1,9 @@ -{lib, ...}: let - inherit (lib) mkMappingOption mkEnableOption; +{ + pkgs, + lib, + ... +}: let + inherit (lib) mkMappingOption mkEnableOption mkOption types; in { options.vim.telescope = { mappings = { @@ -29,5 +33,21 @@ in { }; enable = mkEnableOption "telescope.nvim: multi-purpose search and picker utility"; + + vimgrep_arguments = mkOption { + description = "Arguments to use for the grep command"; + type = types.listOf types.str; + default = [ + "${pkgs.ripgrep}/bin/rg" + "--color=never" + "--no-heading" + "--with-filename" + "--line-number" + "--column" + "--smart-case" + "--hidden" + "--no-ignore" + ]; + }; }; } From 9cb7239085f3901c6a7c0da5dbc17cf698f5d761 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Wed, 28 Feb 2024 00:33:40 +0300 Subject: [PATCH 2/4] languages/css: add formatter support via prettier/prettierd --- modules/languages/css.nix | 50 +++++++++++++++++++++++++++++++++- modules/languages/tailwind.nix | 2 +- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/modules/languages/css.nix b/modules/languages/css.nix index c39ff40..a28f391 100644 --- a/modules/languages/css.nix +++ b/modules/languages/css.nix @@ -32,6 +32,33 @@ ''; }; }; + + defaultFormat = "prettier"; + formats = { + prettier = { + package = pkgs.nodePackages.prettier; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.prettier.with({ + command = "${cfg.format.package}/bin/prettier", + }) + ) + ''; + }; + + prettierd = { + package = pkgs.prettierd; + nullConfig = '' + table.insert( + ls_sources, + null_ls.builtins.formatting.prettier.with({ + command = "${cfg.format.package}/bin/prettierd", + }) + ) + ''; + }; + }; in { options.vim.languages.css = { enable = mkEnableOption "CSS language support"; @@ -58,6 +85,22 @@ in { default = servers.${cfg.lsp.server}.package; }; }; + + format = { + enable = mkEnableOption "CSS formatting" // {default = config.vim.languages.enableFormat;}; + + type = mkOption { + description = "CSS formatter to use"; + type = with types; enum (attrNames formats); + default = defaultFormat; + }; + + package = mkOption { + description = "CSS formatter package"; + type = types.package; + default = formats.${cfg.format.type}.package; + }; + }; }; config = mkIf cfg.enable (mkMerge [ @@ -68,7 +111,12 @@ in { (mkIf cfg.lsp.enable { vim.lsp.lspconfig.enable = true; - vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig; + vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig; + }) + + (mkIf cfg.format.enable { + vim.lsp.null-ls.enable = true; + vim.lsp.null-ls.sources.css-format = formats.${cfg.format.type}.nullConfig; }) ]); } diff --git a/modules/languages/tailwind.nix b/modules/languages/tailwind.nix index 543eac8..3766c70 100644 --- a/modules/languages/tailwind.nix +++ b/modules/languages/tailwind.nix @@ -51,7 +51,7 @@ in { config = mkIf cfg.enable (mkMerge [ (mkIf cfg.lsp.enable { vim.lsp.lspconfig.enable = true; - vim.lsp.lspconfig.sources.css-lsp = servers.${cfg.lsp.server}.lspConfig; + vim.lsp.lspconfig.sources.tailwindcss-lsp = servers.${cfg.lsp.server}.lspConfig; }) ]); } From 0ce5437c8f0ae12abb40b90288ebaace10b40ea9 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 8 Apr 2024 04:35:35 +0300 Subject: [PATCH 3/4] docs: add notice of maintenance we're still developing neovim-flake :) --- .github/README.md | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/README.md b/.github/README.md index 780e34b..82f470c 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,7 +1,16 @@
neovim-flake Logo
+

❄️ neovim-flake

+ +
+ + A highly modular, configurable, extensible and easy to use Neovim configuration wrapper written in Nix. Designed for flexibility and ease of use and with code quality in mind. + +
+
+

@@ -27,14 +36,15 @@

- -
- - A highly modular, configurable, extensible and easy to use Neovim configuration wrapper written in Nix. Designed for flexibility and ease of use, this flake allows you to easily configure your Neovim instance with a few lines of Nix code. -
+
-
+> [!WARNING] +> Main branch is only updated for small, non-breaking changes. For the latest version of neovim-flake, please see +> [the list of branches](https://github.com/NotAShelf/neovim-flake/branches) or +> [open pull requests](https://github.com/NotAShelf/neovim-flake/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc). +> neovim-flake, at the time, is still being actively developed - and will continue to be so for the foreseeable +> future. --- @@ -80,13 +90,16 @@ nix run github:notashelf/neovim-flake#tidal Similar instructions will apply for `nix profile install`. However, you are recommended to instead use the module system as described in the manual. > [!NOTE] -> The `maximal` configuration is _massive_ and will take a while to build. To get a feel for the configuration, use the default `nix` or `tidal` configurations. -> Should you choose to try out the `maximal` configuration, using the binary cache as described in the manual is _strongly_ recommended. +> The `maximal` configuration is _massive_ and will take a while to build. +> To get a feel for the configuration, use the default `nix` or `tidal` configurations. +> Should you choose to try out the `maximal` configuration, using the binary cache as described +> in the manual is _strongly_ recommended. ### Docker -As of version 0.5, an image for the `nix` output is published to Dockerhub and GitHub packages with each tagged release. If you do not have Nix installed -on your system, you may run neovim within a container using your favorite tool. +As of version 0.5, an image for the `nix` output is published to Dockerhub and GitHub packages with each tagged release. If you do not have Docker installed +on your system, you may run neovim within a container using your favorite tool. You are still recommended to use `nix` instead of Docker. + The following command will open the current directory in neovim with necessary tools bootstrapped. ```console @@ -191,3 +204,7 @@ I am grateful for their previous work and inspiration, and I wholeheartedly reco
--- + +
+ Back to the Top +
From 7af67637c57745676a0c5a672a816bbf43a1b5cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:45:46 +0000 Subject: [PATCH 4/4] chore(deps): bump peaceiris/actions-gh-pages from 3 to 4 Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4. - [Release notes](https://github.com/peaceiris/actions-gh-pages/releases) - [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4) --- updated-dependencies: - dependency-name: peaceiris/actions-gh-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/manual.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml index 7463585..855ee9c 100644 --- a/.github/workflows/manual.yml +++ b/.github/workflows/manual.yml @@ -36,7 +36,7 @@ jobs: cp -r result/share/doc/neovim-flake public - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public