When I get dropped into a devShell, which is based on the devShell I define in a flake.nix and direnv “activates” it for me, certain tools have working (auto-)completions and certain tools do not.
I was not able to figure out on a surface-level, how I would/should fix this. Since I work a lot with Rust projects I added this for cargo / (oxalica/crane) related tooling.
devShells.default = craneLib.devShell (
{
shellHook = ''
export FPATH="${toolchain}/share/zsh/site-functions''${FPATH:+:$FPATH}"
'';
}
Since this differs between shells, I was wondering whether anyone partially solved this issue for any shell or found a generic approach or whether I missed some cool feature already in nix/nixOS that solves this issue?
Would something be like this “canonical”:
shellHook = ''
export FPATH="${lib.makeSearchPath "share/zsh/site-functions" packages}''${FPATH:+:$FPATH}"
'';
where packages is the packages I give to the devShell?