revert: shell wrapper for neovim's terminal still useless on macOS

This commit is contained in:
Ryan Yin
2023-12-07 10:47:08 +08:00
parent 989989ecc6
commit d13a353921
2 changed files with 98 additions and 130 deletions

View File

@@ -72,14 +72,6 @@ return {
end,
},
{
"akinsho/toggleterm.nvim",
opts = function(_, opts)
-- custom shell with all neovim's exra packags accessible
opts.shell = "nvim-nushell"
end,
},
{
"0x00-ketsu/autosave.nvim",
-- lazy-loading on events

View File

@@ -38,8 +38,7 @@
# ];
# Extra packages only available to nvim(won't pollute the global home environment)
extraPackages = with pkgs; let
nvim_extra =
extraPackages = with pkgs;
[
#-- c/c++
cmake
@@ -152,29 +151,6 @@
verible
]
);
in
nvim_extra
++ [
# NOTE: shells installed by nix-darwin will ignore the `PATH` env passed by parent process,
# it's likely a bug of nix-darwin, `PATH` passing on NixOS works fine.
#
# So to access the packages we installed here in neovim's shell session(`:terminal`),
# we have to create a shell wrapper with the packages in `PATH` env.
(pkgs.runCommand "nvim-shell" rec {
nativeBuildInputs =
nvim_extra
++ [
pkgs.nushell
pkgs.bash
];
PATH = lib.makeBinPath nativeBuildInputs;
} ''
mkdir -p $out/bin
ln -s ${pkgs.nushell}/bin/nu $out/bin/nvim-nushell
ln -s ${pkgs.bash}/bin/bash $out/bin/nvim-bash
'')
];
};
};
}