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); f system pkgs);
in { in {
packages = forAllSystems (system: pkgs: { packages = forAllSystems (system: pkgs: {
neovim = self.packages.${system}.default; neovim = pkgs.callPackage ./neovim.nix {};
default = pkgs.callPackage ./neovim.nix {}; default = self.packages.${system}.neovim;
}); });
devShells = forAllSystems (system: pkgs: { devShells = forAllSystems (system: pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {

View File

@@ -82,6 +82,11 @@
vscode-langservers-extracted vscode-langservers-extracted
]; ];
packages = with pkgs; [
ripgrep
lf
];
foldPlugins = builtins.foldl' (acc: next: acc ++ [next] ++ (foldPlugins (next.dependencies or []))) []; foldPlugins = builtins.foldl' (acc: next: acc ++ [next] ++ (foldPlugins (next.dependencies or []))) [];
startPluginsWithDeps = lib.unique (foldPlugins startPlugins); startPluginsWithDeps = lib.unique (foldPlugins startPlugins);
@@ -128,11 +133,13 @@ in
paths = let paths = let
wrappedNvim = pkgs.writeShellScriptBin "nvim" '' wrappedNvim = pkgs.writeShellScriptBin "nvim" ''
export PATH=${lib.makeBinPath languageServers}:$PATH export PATH=${lib.makeBinPath (languageServers ++ packages)}:$PATH
${lib.getExe nvimPkg} "$@" ${lib.getExe nvimPkg} "$@"
''; '';
in [wrappedNvim]; in [wrappedNvim];
nativeBuildInputs = [makeWrapper]; nativeBuildInputs = [makeWrapper];
postBuild = '' postBuild = ''
wrapProgram $out/bin/nvim \ wrapProgram $out/bin/nvim \
--add-flags '-u' \ --add-flags '-u' \
@@ -145,4 +152,8 @@ in
passthru = { passthru = {
inherit packpath; inherit packpath;
}; };
meta = {
mainProgram = "nvim";
};
} }