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: add support for prezto configuration framework #655

Merged
merged 1 commit into from Oct 12, 2020

Conversation

NickHu
Copy link
Collaborator

@NickHu NickHu commented Apr 8, 2019

This commit adds support for prezto, an alternative to oh-my-zsh. Currently it depends on NixOS/nixpkgs#59134 to some extent (this pull request actually makes it so that $HOME/.zpreztorc is sourced).

@rycee
Copy link
Member

rycee commented Apr 9, 2019

Thanks for the contribution! I'm a bit worried about the size of this, though. Maintaining this will be a large job. And I'm worried about having two completely separate configuration frameworks in the same HM module.

If it's added then perhaps could have something simpler like

prezto = {
  settings = mkOption { type = types.attrsOf types.str; … };
  load = mkOption { type = types.attrsOf types.str; … };
  moduleConfig = mkOption { type = types.attrsOf (types.attrsOf types.str); … };
};

so that a configuration could be along the lines of

{
  prezto = {
    settings.case-sensitive = true;
    load = {
      pmodule-dirs = "$HOME/.zprezto-contrib";
    };
    module = {
      prompt.pwd-length = "long";
    };
  };
}

But I usually excuse myself when it comes to zsh module changes so I'll defer to the opinion of the zsh expert @uvNikita 🙂

@NickHu
Copy link
Collaborator Author

NickHu commented Apr 9, 2019

The reason for its size is so that everything can be configured from home-manager; I'm not sure that it should require much maintenance.

@teto
Copy link
Collaborator

teto commented Apr 14, 2019

Seems like there is some overlap between these ZSH frameworks and nix. There are settings for python env, more plugins, ruby, ssh identities. IMHO, the most value is made of nix is when settings are redundant or interdependant between software. This seems like it can remain selfcontained so why not just copy the configuration files ?

@NickHu
Copy link
Collaborator Author

NickHu commented May 17, 2020

@teto Yes, there is some overlap. The main advantage of these frameworks is that they're able to configure various plugins with minimal setup; nobody has bothered to write a nix-centric zsh plugin manager, so the next best thing is to co-opt an existing one in this way (as home-manager already does with oh-my-zsh).

@rycee It's been a year now and I've taken to patching home-manager to include this every time I update, so I would really like some incarnation of this to be merged. I think I was right in saying that it's effectively no-maintenance (the patch has applied cleanly every time), so how would you feel about merging now? Perhaps a neat way of splitting it up is to put most of the implementation in its own file (say something like modules/programs/zsh/prezto.nix) and using the import mechanism in the main zsh nix expression. I doubt the implementation would ever need to be changed, and I'm happy to take on responsibility for updating it if it ever does.

@anna328p
Copy link
Contributor

I am also very interested in seeing this merged. I am currently using NickHu's fork of home-manager, which is understandably behind by many commits

@NickHu NickHu force-pushed the prezto branch 2 times, most recently from a1c5fd3 to 7bbef62 Compare September 24, 2020 12:49
@NickHu
Copy link
Collaborator Author

NickHu commented Sep 24, 2020

I've moved the prezto stuff to its own file to keep zsh.nix a bit slimmer; like I said before, prezto has a very very stable interface and this patch has applied cleanly since I wrote it over a year ago. If there are no objections then I'll add myself to the codeowners and merge this in.

modules/programs/zsh.nix Outdated Show resolved Hide resolved
modules/programs/zsh.nix Outdated Show resolved Hide resolved
modules/programs/zsh.nix Outdated Show resolved Hide resolved
modules/programs/zsh.nix Outdated Show resolved Hide resolved
modules/programs/zsh.nix Outdated Show resolved Hide resolved
modules/programs/zsh.nix Outdated Show resolved Hide resolved
modules/programs/zsh.nix Outdated Show resolved Hide resolved
@rycee
Copy link
Member

rycee commented Sep 24, 2020

Added a few comments but since I don't use zsh I can't review properly. If you don't agree with the comments then feel free to merge.

@NickHu NickHu merged commit 18a05a9 into nix-community:master Oct 12, 2020
@NickHu NickHu deleted the prezto branch October 12, 2020 00:28
malte-v pushed a commit to malte-v/home-manager that referenced this pull request Feb 24, 2021
aakropotkin pushed a commit to aakropotkin/home-manager that referenced this pull request Feb 28, 2021
cab404 pushed a commit to cab404/home-manager that referenced this pull request Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants