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 15 ''; 16 16 }; 17 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 + 18 28 plugins = mkOption { 19 29 default = []; 20 30 type = types.listOf(types.str); ··· 46 56 # Prevent zsh from overwriting oh-my-zsh's prompt 47 57 programs.zsh.promptInit = mkDefault ""; 48 58 49 - environment.systemPackages = with pkgs; [ oh-my-zsh ]; 59 + environment.systemPackages = [ cfg.package ]; 50 60 51 - programs.zsh.interactiveShellInit = with pkgs; with builtins; '' 61 + programs.zsh.interactiveShellInit = with builtins; '' 52 62 # oh-my-zsh configuration generated by NixOS 53 - export ZSH=${oh-my-zsh}/share/oh-my-zsh 63 + export ZSH=${cfg.package}/share/oh-my-zsh 54 64 55 65 ${optionalString (length(cfg.plugins) > 0) 56 66 "plugins=(${concatStringsSep " " cfg.plugins})"