zsh plugins: use omz-compatible paths #101007
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: This is my first pull request, I apologize in advance for
anything bad or non-standard I may have done. Point me in the right
direction and I'll try to correct it.
Motivation for this change
This allows for easier configuration of zsh through NixOS configuration.
The
programs.zsh.ohMyZsh.customPkgs
option expects that argumentspassed to it will have a zsh plugin/theme/completion in a path like
$out/share/zsh/{plugins,themes,completions}
, and copies whatever isinside those to
$ZSH_CUSTOM
.However, some packages actually unpacked to
$out/share
, without theproper folder structure, so they never got copied to
$ZSH_CUSTOM
andcaused "not found" errors on zsh startup.
This fixes that, and maintains compatibility with other packages
that might still expect a flatted structure. This is done though a
symlink.
Previously, one could only (at least, it was the only thing that worked
for me) add things like autosuggestions and syntax highlighting though
options like
programs.zsh.autosuggestions.enable
andprograms.zsh.syntaxHighlighting.enable
. Those are still supported,but now adding the appropriate package to
programs.zsh.ohMyZsh.customPkgs
and listing its name inprograms.zsh.ohMyZsh.plugins
works too.Things done
Some packages which unpacked to an improper location where refactored
and symlinked to their old path. I checked all zsh packages, the
unchanged ones seemed to already be working though some are untested. I
can try and test them if requested.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)