Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh plugins: use omz-compatible paths #101007

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

@LuigiPiucco
Copy link
Contributor

@LuigiPiucco LuigiPiucco commented Oct 18, 2020

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 arguments
passed to it will have a zsh plugin/theme/completion in a path like
$out/share/zsh/{plugins,themes,completions}, and copies whatever is
inside those to $ZSH_CUSTOM.

However, some packages actually unpacked to $out/share, without the
proper folder structure, so they never got copied to $ZSH_CUSTOM and
caused "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 and
programs.zsh.syntaxHighlighting.enable. Those are still supported,
but now adding the appropriate package to
programs.zsh.ohMyZsh.customPkgs and listing its name in
programs.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.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
The `programs.zsh.ohMyZsh.customPkgs` option expects that arguments
passed to it will have a zsh plugin/theme/completion in a path like
`$out/share/zsh/{plugins,themes,completions}`, and copies whatever is
inside those to `$ZSH_CUSTOM`.

However, some packages actually unpacked to `$out/share`, without the
proper folder structure, so they never got copied to `$ZSH_CUSTOM` and
caused "not found" errors on zsh startup.

This commit fixes that, and maintains compatibility with other packages
that might still expect a flatted structure. This is done though a
symlink.
@stale
Copy link

@stale stale bot commented Jun 4, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale label Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant