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.

@stale
Copy link

stale bot commented Jun 4, 2021

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

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 4, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 12, 2023
@Janik-Haag
Copy link
Member

Hi, I'm so sorry no one reviewed this especially since this was your first pr. I sadly don't know zsh well enough to reviews this. Are you still interested in getting this merged, if you are just ping me and I will ask in the matrix if some one could review this.

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 flattened structure. This is done though a
symlink.
@LuigiPiucco
Copy link
Contributor Author

@Janik-Haag

So, 4 years have passed, and I've come to get closure on this. I rebased and updated it. Note that I did not test the new push, as I don't use zsh anymore. I can if requested, but I remember having made sure it worked when I originally sent it, and there was only a small conflict and a misspelling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants