Skip to content

Commit

Permalink
zsh: implement shellInitLast
Browse files Browse the repository at this point in the history
Add a new option called `shellInitLast` to the zsh module. This option
allows users to specify shell script code that will be executed as the
last step during interactive zsh shell initialization.

Signed-off-by: Qiming Chu <[email protected]>
  • Loading branch information
Emin017 committed Feb 17, 2025
1 parent 662fa98 commit b5e6cca
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/programs/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,15 @@ in
Extra local variables defined at the top of {file}`.zshrc`.
'';
};

shellInitLast = mkOption {
type = types.lines;
default = "";
description = ''
Shell script code called during interactive zsh shell
initialisation, this will be the last thing executed in zsh startup.
'';
};
};
};

Expand Down Expand Up @@ -767,7 +776,9 @@ in
''
zprof
'')
]);
] ++
["${cfg.shellInitLast}"]
);
}

(mkIf cfg.oh-my-zsh.enable {
Expand Down

0 comments on commit b5e6cca

Please sign in to comment.