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