programs.zsh.ohMyZsh: add package option to make package overrides on module-base easier

This commit is contained in:
Maximilian Bosch 2017-07-18 16:42:52 +02:00
parent bbafe64bdd
commit 95bf0cc1cb
No known key found for this signature in database
GPG key ID: 091DBF4D1FC46B8E

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})"