aboutsummaryrefslogtreecommitdiffstats
path: root/modules/shell/zsh/default.nix
blob: 66e955694e3218a7de840e2501671b8d912e6756 (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
{ 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 =
			if config.shell.default == "zsh" then
				lib.mkForce "${pkgs.zsh}/bin/zsh"
			else "";

		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.fzf.enable then
	"eval \"$(fzf --zsh)\""
else ""}
${builtins.readFile ./zshrc}
		'';
	};
}