1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 23:21:02 +01:00
home-manager/modules/programs/zsh/plugins/zprof.nix
Austin Horstman 196487c54f zsh: group plugins in a separate directory
Make it more scalable to prevent crowding the main folder.

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-07-12 11:42:00 -05:00

37 lines
699 B
Nix

{
config,
lib,
...
}:
let
inherit (lib) mkOption types;
cfg = config.programs.zsh;
in
{
imports = [
(lib.mkRenamedOptionModule [ "programs" "zsh" "zproof" ] [ "programs" "zsh" "zprof" ])
];
options.programs.zsh.zprof = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Enable zprof in your zshrc.
'';
};
};
config = lib.mkIf cfg.zprof.enable {
programs.zsh.initContent = lib.mkMerge [
# zprof must be loaded before everything else, since it
# benchmarks the shell initialization.
(lib.mkOrder 400 ''
zmodload zsh/zprof
'')
(lib.mkOrder 1450 "zprof")
];
};
}