-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathshell.nix
101 lines (99 loc) · 2.17 KB
/
shell.nix
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
config,
lib,
pkgs,
...
}: let
aliases = {
neofetch = "fastfetch";
ncdu = "gdu";
cat = "bat -pp";
};
zshCustomPrefix = "oh-my-zsh";
commonVariables = {
LANG = "en_US.UTF-8";
GPG_TTY = "/dev/ttys000";
DEFAULT_USER = "${config.home.username}";
CLICOLOR = 1;
LS_COLORS = "ExFxBxDxCxegedabagacad";
TERM = "xterm-256color";
MISE_ENV_FILE = ".env";
};
in {
programs.atuin = {
enable = true;
package = pkgs.atuin;
flags = [];
};
# configure zsh custom plugin directory
xdg = let
mkZshPlugin = {
pkg,
plugin ? pkg.pname,
}: {
"${zshCustomPrefix}/plugins/${plugin}" = {
source = "${pkg.src}";
recursive = true;
};
};
in {
enable = true;
dataFile = lib.mkMerge [
(mkZshPlugin {pkg = pkgs.zsh-autopair;})
(mkZshPlugin {pkg = pkgs.zsh-completions;})
(mkZshPlugin {pkg = pkgs.zsh-autosuggestions;})
(mkZshPlugin {
pkg = pkgs.zsh-fast-syntax-highlighting;
plugin = "fast-syntax-highlighting";
})
(mkZshPlugin {pkg = pkgs.zsh-history-substring-search;})
];
};
programs.zsh = {
enable = true;
autocd = true;
dotDir = ".config/zsh";
sessionVariables =
commonVariables
// {
ZSH_CUSTOM = "${config.xdg.dataHome}/${zshCustomPrefix}";
};
shellAliases = aliases;
initExtra = ''
unset RPS1
'';
profileExtra = ''
${lib.optionalString pkgs.stdenvNoCC.isLinux "[[ -f /etc/profile ]] && source /etc/profile"}
'';
oh-my-zsh = {
enable = true;
plugins = [
"1password"
"argocd"
"brew"
"git"
"kitty"
"mise"
"poetry"
"starship"
"sudo"
"zoxide"
# order matters for these ones, probably
"zsh-autopair"
"zsh-completions"
"zsh-autosuggestions"
"fast-syntax-highlighting"
"zsh-history-substring-search"
];
};
};
programs.bash = {
enable = true;
shellAliases = aliases;
sessionVariables = commonVariables;
initExtra = ''
eval "$(mise activate bash)"
eval "$(mise hook-env -s bash)"
'';
};
}