From 6169690ae38175295605d521bd778d999fbd85cd Mon Sep 17 00:00:00 2001 From: winston Date: Thu, 9 Mar 2023 06:21:17 +0100 Subject: [PATCH] zsh: add `package` option to `oh-my-zsh` Allow setting a custom package for `programs.zsh.oh-my-zsh`. --- modules/programs/zsh.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 9ffe9dfac..f612aaaa8 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -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