neovim with runtime path success. check: `:tree-sittersitter` vs tree-sitter on shell

top-level-nix
Pegasust 2022-12-26 04:03:56 -07:00
parent 9944604a38
commit c94520edbe
1 changed files with 29 additions and 14 deletions

View File

@ -18,13 +18,15 @@ let
# an alternative to bash script when I move to OpenColo # an alternative to bash script when I move to OpenColo
# pkgs.gccStdenv # pkgs.gccStdenv
# pkgs.gcc # pkgs.gcc
# pkgs.tree-sitter pkgs.tree-sitter
pkgs.fzf # file name fuzzy search pkgs.fzf # file name fuzzy search
# pkgs.sumneko-lua-language-server # pkgs.sumneko-lua-language-server
pkgs.ripgrep # content fuzzy search pkgs.ripgrep # content fuzzy search
pkgs.zk # Zettelkasten (limited support) pkgs.zk # Zettelkasten (limited support)
pkgs.fd # Required by a Telescope plugin (?) pkgs.fd # Required by a Telescope plugin (?)
pkgs.stdenv.cc.cc.lib pkgs.stdenv.cc.cc.lib
rust_pkgs
pkgs.rust-analyzer
# Python3 as alternative to bash scripts :^) # Python3 as alternative to bash scripts :^)
# (pkgs.python310Full.withPackages (pypkgs: [ # (pkgs.python310Full.withPackages (pypkgs: [
# # python-lsp-server's dependencies is absolutely astronomous # # python-lsp-server's dependencies is absolutely astronomous
@ -40,18 +42,29 @@ let
extensions = [ "rust-src" ]; extensions = [ "rust-src" ];
} }
)); ));
my_neovim = pkgs.neovim-unwrapped.overrideDerivation (old: { # NOTE: Failure 1: buildInputs is pretty much ignored
# TODO: is there a more beautiful way to override propagatedBuildInputs? # my_neovim = pkgs.neovim-unwrapped.overrideDerivation (old: {
name = "hungtr-" + old.name; # # TODO: is there a more beautiful way to override propagatedBuildInputs?
buildInputs = (old.buildInputs or []) ++ [ # name = "hungtr-" + old.name;
pkgs.tree-sitter # highlighting # buildInputs = (old.buildInputs or []) ++ [
rust_pkgs # for potentially rust-analyzer # pkgs.tree-sitter # highlighting
pkgs.fzf # rust_pkgs # for potentially rust-analyzer
pkgs.ripgrep # pkgs.fzf
pkgs.zk # pkgs.ripgrep
pkgs.fd # pkgs.zk
]; # pkgs.fd
}); # ];
# NOTE: Failure 2: propagatedBuildInputs probably only concerns dyn libs
# });
# NOTE: Failure 3: must be unwrapped neovim because home-manager does the wrapping
# my_neovim = pkgs.neovim;
# NOTE: Add packages to nvim_pkgs instead, so that it's available at userspace
# and is added to the path after wrapping.
# check: nix repl `homeConfigurations.hungtr.config.programs.neovim.finalPackage.buildCommand`
# see: :/--suffix.*PATH
# there should be mentions of additional packages
my_neovim = pkgs.neovim-unwrapped;
inherit (myLib) fromYaml; inherit (myLib) fromYaml;
in in
{ {
@ -84,7 +97,9 @@ in
# pkgs.python310.numpy # pkgs.python310.numpy
# pkgs.python310Packages.tensorflow # pkgs.python310Packages.tensorflow
# pkgs.python310Packages.scikit-learn # pkgs.python310Packages.scikit-learn
] ++ (myHome.packages or [ ]) ++ nvim_pkgs); ] ++ (myHome.packages or [ ])
# ++ nvim_pkgs
);
## Configs ## ## Configs ##
xdg.configFile."nvim/init.lua".source = "${proj_root.config.path}//neovim/init.lua"; xdg.configFile."nvim/init.lua".source = "${proj_root.config.path}//neovim/init.lua";