fenix icon indicating copy to clipboard operation
fenix copied to clipboard

How to enable completions?

Open giggio opened this issue 1 year ago • 2 comments

Completions are usually made available by rustup, which this package does not provide, IIRC. How can we get completions when using Fenix?

Temporary workaround, add a derivation that just copies the existing derivation to the expected directory: https://github.com/giggio/dotfiles/blob/448289156397e3d0aec40e2b7d22af13914ce2f0/config/home-manager/rust/cargo-completions.nix

giggio avatar Jun 01 '24 20:06 giggio

After investigating it seems that completions are already in the package, at etc/bash_completion.d/cargo, it is just a matter of adding them to the derivation.

giggio avatar Jun 04 '24 01:06 giggio

I think something like

if [ -d $out/etc/bash_completion.d ]; then
  mkdir -p $out/share/bash-completion/completions
  cp $out/etc/bash_completion.d/* $out/share/bash-completion/completions
fi

needed to be added to installPhase in mk-toolchain.nix,

(sorry, im not familiar enough with git to make proper PR)

AloisMisery avatar Aug 24 '24 01:08 AloisMisery