zsh: add package option to oh-my-zsh

Allow setting a custom package for `programs.zsh.oh-my-zsh`.
This commit is contained in:
winston 2023-03-09 06:21:17 +01:00 committed by Robert Helgesson
parent 5cd5a1b585
commit 6169690ae3
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89

View file

@ -142,6 +142,8 @@ let
options = {
enable = mkEnableOption "oh-my-zsh";
package = mkPackageOption pkgs "oh-my-zsh" { };
plugins = mkOption {
default = [];
example = [ "git" "sudo" ];
@ -447,7 +449,7 @@ in
(mkIf cfg.oh-my-zsh.enable {
home.file."${relToDotDir ".zshenv"}".text = ''
ZSH="${pkgs.oh-my-zsh}/share/oh-my-zsh";
ZSH="${cfg.oh-my-zsh.package}/share/oh-my-zsh";
ZSH_CACHE_DIR="${config.xdg.cacheHome}/oh-my-zsh";
'';
})
@ -482,7 +484,7 @@ in
{
home.packages = with pkgs; [ zsh ]
++ optional cfg.enableCompletion nix-zsh-completions
++ optional cfg.oh-my-zsh.enable oh-my-zsh;
++ optional cfg.oh-my-zsh.enable cfg.oh-my-zsh.package;
home.file."${relToDotDir ".zshrc"}".text = concatStringsSep "\n" ([
cfg.initExtraFirst