blob: e4604c5e22137df3c636f163cdb3b307260301c3 (
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
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
|
{ userName, pkgs, customUtils, lib, config, ... }:
{
config = {
nixpkgs.externalConfig.allowUnfreePackages = [
"zsh-abbr"
];
home-manager.users.${userName} = let sysConfig = config; in { config, ... }: {
config = {
programs.zsh = {
dotDir = "${config.xdg.configHome}/zsh";
enable = true;
autocd = true;
enableCompletion = true;
enableVteIntegration = true;
history = {
append = true;
expireDuplicatesFirst = true;
extended = true;
findNoDups = true;
};
syntaxHighlighting.enable = true;
zsh-abbr = {
enable = true;
abbreviations = {
re = "systemctl restart";
ure = "systemctl --user restart";
st = "systemctl status";
ust = "systemctl --user status";
};
globalAbbreviations = {
"L" = "| less";
"S" = "&> /dev/null";
"G" = "| grep";
"B" = "&> /dev/null &";
"BB" = "&> /dev/null &!";
"J" = lib.mkIf config.programs.jq.enable "| jq '.'";
};
};
initContent = lib.mkMerge [
(lib.mkBefore ''
if [[ $TERM == "dumb" ]]; then
unsetopt zle
PS1='$ '
return
fi
'')
(lib.mkAfter ''
source ${./zshrc}
'')
];
};
programs.starship = {
enable = true;
settings = {
direnv.disabled = false;
add_newline = false;
directory.truncate_to_repo = false;
git_status.disabled = true;
};
};
};
};
programs.zsh.enable = true;
environment.pathsToLink = [ "/share/zsh" ];
environment.shellAliases = lib.mkOverride 90 {};
};
}
|