blob: 96df96756685f21ca8f2812ec5d4c8f0443d938c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
{ config, lib, pkgs, ... }:
{
options.shell.zsh = {
enable = lib.mkEnableOption "Enables zsh.";
};
config = lib.mkIf config.shell.zsh.enable {
shell.default = lib.mkDefault "zsh";
shell.command =
lib.mkIf
(config.shell.default == "zsh")
"${pkgs.zsh}/bin/zsh";
programs.zsh.enable = true;
programs.zsh.dotDir = ".config/zsh";
programs.zsh.history.path = "${config.xdg.cacheHome}/zsh/history";
programs.zsh.shellAliases = config.shell.alias;
programs.zsh.initExtra = ''
${if config.tools.utils.fzf.enable then
"eval \"$(fzf --zsh)\""
else ""}
${builtins.readFile ./zshrc}
${if config.scripts.enable then
"export PATH=${config.home.homeDirectory}/scripts:$PATH"
else ""}
'';
};
}
|