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

Add configuration params for oh-my-zsh #25140

Merged
merged 7 commits into from Apr 23, 2017
Merged

Add configuration params for oh-my-zsh #25140

merged 7 commits into from Apr 23, 2017

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Apr 23, 2017

Motivation for this change

After switching to NixOS I decided to create a global ZSH profile for each of the users based on oh-my-zsh.

Unfortunately I had to set a lot of params manually using interactiveShellInit. This PR aims to make oh-my-zsh configuration easier by adding some params to be used in configuration.nix.

I tested it by using the following configuration in a test VM:

{ # ...
  programs.zsh = {
    enable = true;
    oh-my-zsh = {
      enable = true;
      plugins = [ "sudo" "scala" ];
      custom = "foobar";
      theme = "norm";
    };
  };
}

When starting the VM (which was created by running NIXOS_CONFIG=`pwd`/vmtest.nix nixos-rebuild -I nixpkgs=$HOME/Projects/nixpkgs/ build-vm) everything worked fine.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@Ma27, thanks for your PR! By analyzing the history of the files in this pull request, we identified @oxij, @edolstra and @spwhitt to be potential reviewers.

@Mic92
Copy link
Member

Mic92 commented Apr 23, 2017

I would prefer to have a dedicated module and an own scope for oh my zsh (so zsh.ohMyZshEnable would become zsh.oh-my-zsh.enable).

@@ -143,6 +174,26 @@ in

${cfge.interactiveShellInit}

${optionalString (cfg.enableOhMyZsh)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In an external module this would be then moved to: programs.zsh.interactiveShellInit

@Ma27
Copy link
Member Author

Ma27 commented Apr 23, 2017

I would prefer to have a dedicated module and an own scope for oh my zsh

good point.

@Ma27
Copy link
Member Author

Ma27 commented Apr 23, 2017

@Mic92 done.
I moved everything to a new module named oh-my-zsh.nix and rechecked everything in a VM (see the updated description for the used configuration).
Is there anythign else to be done before merging? :-)

@Mic92 Mic92 merged commit 9ec64d2 into NixOS:master Apr 23, 2017
@Mic92
Copy link
Member

Mic92 commented Apr 23, 2017

Thanks!

@Ma27 Ma27 deleted the zsh/oh-my-zsh-config branch April 23, 2017 12:03
@Ma27
Copy link
Member Author

Ma27 commented Apr 23, 2017

thanks for merging :-)

Just out of interest: the current nixos-unstable channel is according to the nixpkgs-channels repository 8 days behind. Is there anything wrong ATM (or when is a new channel update expected?)

@Mic92 Mic92 mentioned this pull request Apr 24, 2017
7 tasks
peti pushed a commit that referenced this pull request Jun 12, 2017
* programs.zsh: add enableOhMyZsh option to automate setup of oh-my-zsh in global zshrc

* programs.zsh: make oh-my-zsh plugins configurable

* programs.zsh: add ohMyZshCustom option

* programs.zsh: add ohMyZshTheme option

* programs.zsh: applying minor fixes to evaluate expressions properly

* programs.zsh: fix ordering of oh-my-zsh config and execution

* programs.zsh: move all oh-my-zsh params into its own scope named programs.zsh.oh-my-zsh

(cherry picked from commit 9ec64d2)
ambrop72 pushed a commit to ambrop72/nixpkgs that referenced this pull request Jun 21, 2017
* programs.zsh: add enableOhMyZsh option to automate setup of oh-my-zsh in global zshrc

* programs.zsh: make oh-my-zsh plugins configurable

* programs.zsh: add ohMyZshCustom option

* programs.zsh: add ohMyZshTheme option

* programs.zsh: applying minor fixes to evaluate expressions properly

* programs.zsh: fix ordering of oh-my-zsh config and execution

* programs.zsh: move all oh-my-zsh params into its own scope named programs.zsh.oh-my-zsh

(cherry picked from commit 9ec64d2)
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

3 participants