Merge pull request #27469 from Ma27/oh-my-zsh/make-pkg-configurable

programs.zsh.ohMyZsh: add `package` option to make package overrides on module-base easier
This commit is contained in:
Jörg Thalheim 2017-07-22 10:00:35 +01:00 committed by GitHub
commit b1bff52a5c

View file

@ -15,6 +15,16 @@ in
'';
};
package = mkOption {
default = pkgs.oh-my-zsh;
defaultText = "pkgs.oh-my-zsh";
description = ''
Package to install for `oh-my-zsh` usage.
'';
type = types.package;
};
plugins = mkOption {
default = [];
type = types.listOf(types.str);
@ -46,11 +56,11 @@ in
# Prevent zsh from overwriting oh-my-zsh's prompt
programs.zsh.promptInit = mkDefault "";
environment.systemPackages = with pkgs; [ oh-my-zsh ];
environment.systemPackages = [ cfg.package ];
programs.zsh.interactiveShellInit = with pkgs; with builtins; ''
programs.zsh.interactiveShellInit = with builtins; ''
# oh-my-zsh configuration generated by NixOS
export ZSH=${oh-my-zsh}/share/oh-my-zsh
export ZSH=${cfg.package}/share/oh-my-zsh
${optionalString (length(cfg.plugins) > 0)
"plugins=(${concatStringsSep " " cfg.plugins})"