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

+13 -3
+13 -3
nixos/modules/programs/zsh/oh-my-zsh.nix
··· 15 ''; 16 }; 17 18 plugins = mkOption { 19 default = []; 20 type = types.listOf(types.str); ··· 46 # Prevent zsh from overwriting oh-my-zsh's prompt 47 programs.zsh.promptInit = mkDefault ""; 48 49 - environment.systemPackages = with pkgs; [ oh-my-zsh ]; 50 51 - programs.zsh.interactiveShellInit = with pkgs; with builtins; '' 52 # oh-my-zsh configuration generated by NixOS 53 - export ZSH=${oh-my-zsh}/share/oh-my-zsh 54 55 ${optionalString (length(cfg.plugins) > 0) 56 "plugins=(${concatStringsSep " " cfg.plugins})"
··· 15 ''; 16 }; 17 18 + package = mkOption { 19 + default = pkgs.oh-my-zsh; 20 + defaultText = "pkgs.oh-my-zsh"; 21 + description = '' 22 + Package to install for `oh-my-zsh` usage. 23 + ''; 24 + 25 + type = types.package; 26 + }; 27 + 28 plugins = mkOption { 29 default = []; 30 type = types.listOf(types.str); ··· 56 # Prevent zsh from overwriting oh-my-zsh's prompt 57 programs.zsh.promptInit = mkDefault ""; 58 59 + environment.systemPackages = [ cfg.package ]; 60 61 + programs.zsh.interactiveShellInit = with builtins; '' 62 # oh-my-zsh configuration generated by NixOS 63 + export ZSH=${cfg.package}/share/oh-my-zsh 64 65 ${optionalString (length(cfg.plugins) > 0) 66 "plugins=(${concatStringsSep " " cfg.plugins})"