home-manager
home-manager copied to clipboard
fish: consider extra outputs to install completions
Description
After switching to fish, I noticed that some man pages are not considered when generating completions. This is because
- Some packages provide man pages in extraOutputs, e.g. tmux and tmux.man and
- Some packages link man pages, e.g. if a package is wrapped with
buildEnv
.
To fix this I added extraOutputsToInstall
an source for man pages, similar to nixpkgs buildEnv
Checklist
-
[x] Change is backwards compatible.
-
[x] Code formatted with
./format
. -
[x] Code tested through
nix-shell --pure tests -A run.all
. -
[x] Commit messages are formatted like
{component}: {description} {long description}
@hyperfekt IIUC you added the code. Would you mind to review?
Thanks for the contribution! LGTM, but I don't use Fish, so I'll wait for @hyperfekt to say.
About the conflict, it is just to make the script use Python 3. It should be easily resolved by rebasing your branch.
Maybe some else?
CC @tjni @kidonng @pvsr
Could you provide me with some steps to test the difference before and after? I can sanity check it.
On my OSX machine, I tried getting completions after the tmux
command, and I was able to currently without changes. I'm not positive if I am doing something wrong or if it's perhaps an OSX specific quirk that it works.
I can't reproduce either, on OSX or NixOS. Do you have programs.man.generateCaches
enabled? That fixed the issues I was having with man completions.
I'm sorry for not explaining well.
I was testing with
{ pkgs, config, lib, ... }:
{
home.packages = with pkgs; [
tmux
(buildEnv {
name = "some-wrapper";
paths = [ git ];
pathsToLink = [ "/share/man" ];
})
];
programs.fish.enable = true;
}
and looking at home-manager_generated_completions
With upstream home-manager I find
> ls result/home-files/.local/share/fish/home-manager_generated_completions/tmux.fish
ls: cannot access 'result/home-files/.local/share/fish/home-manager_generated_completions/tmux.fish': No such file or directory
> ls result/home-files/.local/share/fish/home-manager_generated_completions/git.fish
ls: cannot access 'result/home-files/.local/share/fish/home-manager_generated_completions/git.fish': No such file or directory
With the patch I get
> ls result/home-files/.local/share/fish/home-manager_generated_completions/tmux.fish
result/home-files/.local/share/fish/home-manager_generated_completions/tmux.fish
> ls result/home-files/.local/share/fish/home-manager_generated_completions/git.fish
result/home-files/.local/share/fish/home-manager_generated_completions/git.fish
I was able to currently without changes. I'm not positive if I am doing something wrong or if it's perhaps an OSX specific quirk that it works.
Maybe you have entries in $HOME/.local/share/fish/generated_completions
? Or maybe fish already had the completions loaded from your previous setup, not sure how fish behaves with removed completion files.
@pvsr programs.man.generateCaches
did not work for me :cry:
@tjni @pvsr any updates?
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.
If you are the original author of the PR
- GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
- If it is unfinished but you plan to finish it, please mark it as a draft.
- If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
- To get things rolling again, rebase the PR against the target branch and address valid comments.
If you are not the original author of the PR
- If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.
@tjni @pvsr: Could you have a second look on this? I'm inclined to merge this even if it seems to already work for some. So I'll merge in a day or two unless somebody tells me otherwise π
Merged to master now π
Thatβs great. Thank you. I can finally use upstream again π