From a67889de1c8db544c19ffbac57a612ffe04ee41b Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Sun, 8 Dec 2024 13:43:04 -0300 Subject: [PATCH] feat: wrapp dependency packages into PATH --- flake.nix | 4 ++-- neovim.nix | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index c1eaa61..a6d27ab 100644 --- a/flake.nix +++ b/flake.nix @@ -25,8 +25,8 @@ f system pkgs); in { packages = forAllSystems (system: pkgs: { - neovim = self.packages.${system}.default; - default = pkgs.callPackage ./neovim.nix {}; + neovim = pkgs.callPackage ./neovim.nix {}; + default = self.packages.${system}.neovim; }); devShells = forAllSystems (system: pkgs: { default = pkgs.mkShell { diff --git a/neovim.nix b/neovim.nix index 73bc4fb..528d4f2 100644 --- a/neovim.nix +++ b/neovim.nix @@ -82,6 +82,11 @@ vscode-langservers-extracted ]; + packages = with pkgs; [ + ripgrep + lf + ]; + foldPlugins = builtins.foldl' (acc: next: acc ++ [next] ++ (foldPlugins (next.dependencies or []))) []; startPluginsWithDeps = lib.unique (foldPlugins startPlugins); @@ -128,11 +133,13 @@ in paths = let wrappedNvim = pkgs.writeShellScriptBin "nvim" '' - export PATH=${lib.makeBinPath languageServers}:$PATH + export PATH=${lib.makeBinPath (languageServers ++ packages)}:$PATH ${lib.getExe nvimPkg} "$@" ''; in [wrappedNvim]; + nativeBuildInputs = [makeWrapper]; + postBuild = '' wrapProgram $out/bin/nvim \ --add-flags '-u' \ @@ -145,4 +152,8 @@ in passthru = { inherit packpath; }; + + meta = { + mainProgram = "nvim"; + }; }