feat: wrapp dependency packages into PATH
This commit is contained in:
@@ -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 {
|
||||
|
||||
13
neovim.nix
13
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";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user