feat: wrapp dependency packages into PATH

This commit is contained in:
Guz
2024-12-08 13:43:04 -03:00
parent 5f6b05c7d3
commit a67889de1c
2 changed files with 14 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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";
};
}