From e752f59994e8f5c912dc2ca7c23d2ae2a5f193fd Mon Sep 17 00:00:00 2001 From: taylrfnt Date: Sun, 4 May 2025 19:05:09 -0500 Subject: [PATCH 1/4] nvimtree: add missing icon placement options - Address missing `right_align` option in existing icon placement attributes - Add the missing placement options from https://github.com/nvim-tree/nvim-tree.lua/blob/582ae48c9e43d2bcd55dfcc8e2e7a1f29065d924/lua/nvim-tree.lua#L595-L599 - Update the `mkOption` arguments to adhere to the requested style guide: ``` 1. type 2. default 3. (optional) example 4. description ``` --- .../plugins/filetree/nvimtree/nvimtree.nix | 41 +++++++++++++++++-- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/modules/plugins/filetree/nvimtree/nvimtree.nix b/modules/plugins/filetree/nvimtree/nvimtree.nix index 9c443a6e..c3beb38f 100644 --- a/modules/plugins/filetree/nvimtree/nvimtree.nix +++ b/modules/plugins/filetree/nvimtree/nvimtree.nix @@ -683,15 +683,48 @@ in { }; git_placement = mkOption { - type = enum ["before" "after" "signcolumn"]; - description = "Place where the git icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled."; + type = enum ["before" "after" "signcolumn" "right_align"]; default = "before"; + description = '' + Place where the git icons will be rendered. + `signcolumn` requires `view.signcolumn` to be enabled. + ''; }; modified_placement = mkOption { - type = enum ["before" "after" "signcolumn"]; - description = "Place where the modified icons will be rendered. `signcolumn` requires `view.signcolumn` to be enabled."; + type = enum ["before" "after" "signcolumn" "right_align"]; default = "after"; + description = '' + Place where the modified icons will be rendered. + `signcolumn` requires `view.signcolumn` to be enabled. + ''; + }; + + hidden_placement = mkOption { + type = enum ["before" "after" "signcolumn" "right_align"]; + default = "after"; + description = '' + Place where the hidden icons will be rendered. + `signcolumn` requires `view.signcolumn` to be enabled. + ''; + }; + + diagnostics_placement = mkOption { + type = enum ["before" "after" "signcolumn" "right_align"]; + default = "after"; + description = '' + Place where the diagnostics icons will be rendered. + `signcolumn` requires `view.signcolumn` to be enabled. + ''; + }; + + bookmarks_placement = mkOption { + type = enum ["before" "after" "signcolumn" "right_align"]; + default = "after"; + description = '' + Place where the bookmark icons will be rendered. + `signcolumn` requires `view.signcolumn` to be enabled. + ''; }; padding = mkOption { From ee0a7e704824b73015234b4e97eab5a59efae364 Mon Sep 17 00:00:00 2001 From: taylrfnt Date: Sun, 4 May 2025 21:11:30 -0500 Subject: [PATCH 2/4] changelog: update with summary of changes (non-breaking) Add a summary of the (non-breaking) changes to the nvim-tree plugin options per contributing guidelines. --- docs/release-notes/rl-0.8.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/release-notes/rl-0.8.md b/docs/release-notes/rl-0.8.md index 80a0300c..e0c06fc8 100644 --- a/docs/release-notes/rl-0.8.md +++ b/docs/release-notes/rl-0.8.md @@ -362,3 +362,11 @@ [Hardtime.nvim]: https://github.com/m4xshen/hardtime.nvim - Add Plugin [Hardtime.nvim] under `vim.binds.hardtime-nvim` with `enable` and `setupOpts` options + +[taylrfnt](https://github.com/taylrfnt): + +[nvim-tree](https://github.com/nvim-tree/nvim-tree.lua): + +- Add missing `right_align` option for existing `renderer.icons` options. +- Add missing `render.icons` options (`hidden_placement`, + `diagnostics_placement`, and `bookmarks_placement`). From 9feb71594d00e5f40b16d39b06b3fd4bad7630a0 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sat, 3 May 2025 17:52:36 -0400 Subject: [PATCH 3/4] refactor: nuke legacyPackages and overlays rework blink-cmp package --- docs/default.nix | 1 + flake.nix | 3 --- flake/blink/default.nix | 31 +++++++++++++++++++++++++ flake/develop.nix | 3 ++- flake/legacyPackages.nix | 35 ---------------------------- flake/legacyPackages/blink-cmp.nix | 37 ------------------------------ flake/overlays.nix | 19 --------------- flake/packages.nix | 15 ++++++++---- lib/default.nix | 2 +- lib/types/default.nix | 7 ++++-- lib/types/plugins.nix | 7 ++++-- modules/plugins/languages/nix.nix | 3 ++- modules/wrapper/build/config.nix | 2 +- npins/sources.json | 16 ------------- 14 files changed, 59 insertions(+), 122 deletions(-) create mode 100644 flake/blink/default.nix delete mode 100644 flake/legacyPackages.nix delete mode 100644 flake/legacyPackages/blink-cmp.nix delete mode 100644 flake/overlays.nix diff --git a/docs/default.nix b/docs/default.nix index 98b29db0..49f90b80 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -12,6 +12,7 @@ inherit ( (lib.evalModules { + specialArgs = {inherit inputs;}; modules = import ../modules/modules.nix { inherit lib pkgs; diff --git a/flake.nix b/flake.nix index 6e716581..e958f91c 100644 --- a/flake.nix +++ b/flake.nix @@ -18,10 +18,7 @@ systems = import inputs.systems; imports = [ ./flake/templates - ./flake/apps.nix - ./flake/legacyPackages.nix - ./flake/overlays.nix ./flake/packages.nix ./flake/develop.nix ]; diff --git a/flake/blink/default.nix b/flake/blink/default.nix new file mode 100644 index 00000000..08c87073 --- /dev/null +++ b/flake/blink/default.nix @@ -0,0 +1,31 @@ +{ + rustPlatform, + fetchFromGitHub, + writeShellScriptBin, +}: +rustPlatform.buildRustPackage (finalAttrs: { + pname = "blink-cmp"; + version = "1.2.0"; + + src = fetchFromGitHub { + owner = "Saghen"; + repo = "blink.cmp"; + tag = "v${finalAttrs.version}"; + hash = "sha256-bKe8SSg1HPWE7b4iRQJwiOVCrvvgttuHCOIa4U/38AY="; + }; + + postInstall = '' + cp -r {lua,plugin} "$out" + mkdir -p "$out/target" + mv "$out/lib" "$out/target/release" + ''; + + cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M="; + useFetchCargoVendor = true; + + nativeBuildInputs = [ + (writeShellScriptBin "git" "exit 1") + ]; + + env.RUSTC_BOOTSTRAP = true; +}) diff --git a/flake/develop.nix b/flake/develop.nix index 71c13688..d92b8182 100644 --- a/flake/develop.nix +++ b/flake/develop.nix @@ -3,13 +3,14 @@ pkgs, config, self', + inputs', ... }: { devShells = { default = self'.devShells.lsp; nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];}; lsp = pkgs.mkShellNoCC { - packages = with pkgs; [nil statix deadnix alejandra npins]; + packages = with pkgs; [inputs'.nil.packages.default statix deadnix alejandra npins]; }; }; diff --git a/flake/legacyPackages.nix b/flake/legacyPackages.nix deleted file mode 100644 index 33aee0e3..00000000 --- a/flake/legacyPackages.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - inputs, - self, - ... -}: { - perSystem = { - system, - inputs', - ... - }: { - legacyPackages = import inputs.nixpkgs { - inherit system; - overlays = [ - inputs.self.overlays.default - - (final: prev: { - # Build nil from source to get most recent - # features as they are added. - nil = inputs'.nil.packages.default; - blink-cmp = let - pin = self.pins.blink-cmp; - in - final.callPackage ./legacyPackages/blink-cmp.nix { - inherit (pin) version; - src = prev.fetchFromGitHub { - inherit (pin.repository) owner repo; - rev = pin.revision; - sha256 = pin.hash; - }; - }; - }) - ]; - }; - }; -} diff --git a/flake/legacyPackages/blink-cmp.nix b/flake/legacyPackages/blink-cmp.nix deleted file mode 100644 index 60dce9de..00000000 --- a/flake/legacyPackages/blink-cmp.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - stdenv, - rustPlatform, - vimUtils, - gitMinimal, - src, - version, -}: let - blink-fuzzy-lib = rustPlatform.buildRustPackage { - pname = "blink-fuzzy-lib"; - inherit version src; - - # TODO: remove this if plugin stops using nightly rust - env.RUSTC_BOOTSTRAP = true; - - useFetchCargoVendor = true; - cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M="; - - nativeBuildInputs = [gitMinimal]; - }; -in - vimUtils.buildVimPlugin { - pname = "blink-cmp"; - inherit version src; - - # blink references a repro.lua which is placed outside the lua/ directory - doCheck = false; - preInstall = let - ext = stdenv.hostPlatform.extensions.sharedLibrary; - in '' - mkdir -p target/release - ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext} - ''; - - # Module for reproducing issues - nvimSkipModules = ["repro"]; - } diff --git a/flake/overlays.nix b/flake/overlays.nix deleted file mode 100644 index 5d0ff6e8..00000000 --- a/flake/overlays.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - lib, - ... -}: let - inherit (lib.nvim) neovimConfiguration; - - buildPkg = pkgs: modules: (neovimConfiguration {inherit pkgs modules;}).neovim; - - nixConfig = import ../configuration.nix false; - maximalConfig = import ../configuration.nix true; -in { - flake.overlays.default = final: _prev: { - inherit neovimConfiguration; - neovim-nix = buildPkg final [nixConfig]; - neovim-maximal = buildPkg final [maximalConfig]; - devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}]; - }; -} diff --git a/flake/packages.nix b/flake/packages.nix index 7abe5ec0..d6afbbf8 100644 --- a/flake/packages.nix +++ b/flake/packages.nix @@ -1,4 +1,4 @@ -{inputs, ...}: { +{inputs, ...} @ args: { perSystem = { config, pkgs, @@ -6,8 +6,15 @@ ... }: let docs = import ../docs {inherit pkgs inputs lib;}; + buildPkg = maximal: + (args.config.flake.lib.nvim.neovimConfiguration { + inherit pkgs; + modules = [(import ../configuration.nix maximal)]; + }).neovim; in { packages = { + blink-cmp = pkgs.callPackage ./blink {}; + inherit (docs.manual) htmlOpenTool; # Documentation docs = docs.manual.html; @@ -61,9 +68,9 @@ ''; # Exposed neovim configurations - nix = config.legacyPackages.neovim-nix; - maximal = config.legacyPackages.neovim-maximal; - default = config.legacyPackages.neovim-nix; + nix = buildPkg false; + maximal = buildPkg true; + default = config.packages.nix; }; }; } diff --git a/lib/default.nix b/lib/default.nix index 952278a8..c4388e82 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -4,7 +4,7 @@ lib, ... }: { - types = import ./types {inherit lib;}; + types = import ./types {inherit lib self;}; config = import ./config.nix {inherit lib;}; binds = import ./binds.nix {inherit lib;}; dag = import ./dag.nix {inherit lib;}; diff --git a/lib/types/default.nix b/lib/types/default.nix index c6239227..044a8221 100644 --- a/lib/types/default.nix +++ b/lib/types/default.nix @@ -1,6 +1,9 @@ -{lib}: let +{ + lib, + self, +}: let typesDag = import ./dag.nix {inherit lib;}; - typesPlugin = import ./plugins.nix {inherit lib;}; + typesPlugin = import ./plugins.nix {inherit lib self;}; typesLanguage = import ./languages.nix {inherit lib;}; customTypes = import ./custom.nix {inherit lib;}; in { diff --git a/lib/types/plugins.nix b/lib/types/plugins.nix index fc2bd083..4be39289 100644 --- a/lib/types/plugins.nix +++ b/lib/types/plugins.nix @@ -1,4 +1,7 @@ -{lib}: let +{ + lib, + self, +}: let inherit (lib.options) mkOption; inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair; inherit (lib.strings) hasPrefix removePrefix; @@ -12,7 +15,7 @@ mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs); # Get the names of all npins - pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).pins; + pluginInputNames = ["blink-cmp"] ++ attrNames self.pins; # You can either use the name of the plugin or a package. pluginType = nullOr ( diff --git a/modules/plugins/languages/nix.nix b/modules/plugins/languages/nix.nix index 83022adf..aceee70d 100644 --- a/modules/plugins/languages/nix.nix +++ b/modules/plugins/languages/nix.nix @@ -2,6 +2,7 @@ config, pkgs, lib, + inputs, ... }: let inherit (builtins) attrNames; @@ -27,7 +28,7 @@ else ''{"${package}/bin/${defaultCmd}"}''; servers = { nil = { - package = pkgs.nil; + package = inputs.nil.packages.${pkgs.stdenv.system}.nil; internalFormatter = true; lspConfig = '' lspconfig.nil_ls.setup{ diff --git a/modules/wrapper/build/config.nix b/modules/wrapper/build/config.nix index 61ba1513..00ad2305 100644 --- a/modules/wrapper/build/config.nix +++ b/modules/wrapper/build/config.nix @@ -51,7 +51,7 @@ doCheck = false; }; - inherit (inputs.self.legacyPackages.${pkgs.stdenv.system}) blink-cmp; + inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp; }; buildConfigPlugins = plugins: diff --git a/npins/sources.json b/npins/sources.json index a2122460..8e82850a 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -39,22 +39,6 @@ "url": "https://github.com/rrethy/base16-nvim/archive/965160025d0facbe9caa863e5beef2a7a488e9d1.tar.gz", "hash": "02w1mn15gydma9canvqrlwf4l5z76s1vs01zanipwwflvwclsb8f" }, - "blink-cmp": { - "type": "GitRelease", - "repository": { - "type": "GitHub", - "owner": "saghen", - "repo": "blink.cmp" - }, - "pre_releases": false, - "version_upper_bound": null, - "release_prefix": null, - "submodules": false, - "version": "v1.2.0", - "revision": "d72a826e1961e14f91d8867d10a27a89c5cfe748", - "url": "https://api.github.com/repos/saghen/blink.cmp/tarball/v1.2.0", - "hash": "01phyx7y26p2123xpdp0zfp45rc8f014a8myxn2ga71m514vr9vc" - }, "blink-cmp-spell": { "type": "Git", "repository": { From 7d191a350df23f2cb3f9110105d3b787559f9479 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 5 May 2025 10:45:33 +0300 Subject: [PATCH 4/4] ci: backport & labeler config --- .github/labels.yml | 55 ++++++++++++++++++++++++++++++++++ .github/workflows/backport.yml | 33 ++++++++++++++++++++ .github/workflows/labeler.yml | 21 +++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 .github/labels.yml create mode 100644 .github/workflows/backport.yml create mode 100644 .github/workflows/labeler.yml diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 00000000..e799004f --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,55 @@ +# This file is used by .github/workflows/labels.yml +"topic: plugins": + - any: + - changed-files: + - any-glob-to-any-file: + - modules/plugins/**/* + +"topic: modules": + - any: + - changed-files: + - any-glob-to-any-file: + - modules/**/* + +"topic: dependencies": + - any: + - changed-files: + - any-glob-to-any-file: + - npins + - flake.lock + +"topic: CI": + - any: + - changed-files: + - any-glob-to-any-file: + - .github/workflows/*.yml + - .github/typos.toml + . .github/dependabot.yml + +"topic: meta": + - any: + - changed-files: + - any-glob-to-any-file: + - .github/CODEOWNERS + - LICENSE + - .github/README.md + - .github/funding.yml + - .github/assets + - .github/*_TEMPLATE + - .gitignore + - .editorconfig + - release.json + +"topic: documentation": + - any: + - changed-files: + - any-glob-to-any-file: + - docs/**/* + - .github/CONTRIBUTING.md + - .github/README.md +"topic: packaging": + - any: + - changed-files: + - any-glob-to-any-file: + - flake.nix + - flake/packages.nix diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 00000000..0a558fb8 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,33 @@ +name: Backport PR on Label + +on: + pull_request_target: + types: + - labeled + +# Permissions needed for the korthout/backport-action to create branches and PRs +permissions: + contents: write + pull-requests: write + +jobs: + backport: + name: Create Backport PR + runs-on: ubuntu-latest + if: | + github.event.pull_request.merged == true && startsWith(github.event.label.name, 'backport-') + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + token: ${{ steps.app-token.outputs.token }} + + - name: Backport Action + uses: korthout/backport-action@v3 + with: + # Regex pattern for labels that should trigger a backport AND extracts the target branch + # from the name (e.g. v0.x or v0.x.y; we use zerover). This action will ONLY proceed if + # the label that triggered the workflow fully matches this pattern. + # Example matching labels: "backport-v0.1", "backport-v0.10.1" + # Example non-matching labels: "backport-foo", "backport-v1.0" + label_pattern: '^backport-(v0\.\d+(\.\d+)?)$' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..96d5c7be --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,21 @@ +name: "Label PR" + +on: + pull_request_target: + types: [edited, opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + +jobs: + labels: + name: "Label PR" + runs-on: ubuntu-latest + if: "!contains(github.event.pull_request.title, '[skip ci]')" + steps: + - uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + configuration-path: .github/labeler.yml + sync-labels: true