-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprograms.nix
More file actions
124 lines (115 loc) · 3.24 KB
/
programs.nix
File metadata and controls
124 lines (115 loc) · 3.24 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
config,
lib,
pkgs,
...
}:
let
shell = import ./shell.nix { inherit lib; };
in
{
programs = {
# let home-manager install and manage itself
home-manager.enable = true;
# command-line interpreter
bash = {
enable = true;
enableCompletion = true;
enableVteIntegration = true;
initExtra = ''
eval "$(starship init bash)"
export PATH=$HOME/bin:$PATH
'';
sessionVariables = shell.home.sessionVariables;
};
# replacement for bash
zsh = {
enable = true;
autocd = false;
autosuggestion.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
enableVteIntegration = true;
defaultKeymap = "emacs";
oh-my-zsh.enable = true;
plugins = [
{
name = "fzf-tab";
src = pkgs.fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "5a81e13792a1eed4a03d2083771ee6e5b616b9ab";
sha256 = "sha256-dPe5CLCAuuuLGRdRCt/nNruxMrP9f/oddRxERkgm1FE=";
};
}
];
shellGlobalAliases = {
"..." = "../..";
"...." = "../../..";
"....." = "../../../..";
DN = "2>/dev/null";
};
initContent = ''
# fuzzy tab completion: https://superuser.com/a/815317
zstyle ':completion:*' matcher-list "" \
'm:{a-z\-}={A-Z\_}' \
'r:[^[:alpha:]]||[[:alpha:]]=** r:|=* m:{a-z\-}={A-Z\_}' \
'r:|?=** m:{a-z\-}={A-Z\_}'
eval "$(starship init zsh)"
export PATH=$HOME/bin:$PATH
# This speeds up pasting w/ autosuggest
# https://github.com/zsh-users/zsh-autosuggestions/issues/238
pasteinit() {
OLD_SELF_INSERT=''${''${(s.:.)widgets[self-insert]}[2,3]}
zle -N self-insert url-quote-magic # I wonder if you'd need `.url-quote-magic`?
}
pastefinish() {
zle -N self-insert $OLD_SELF_INSERT
}
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
# disable bracketed paste
unset zle_bracketed_paste
'';
sessionVariables = shell.home.sessionVariables;
dotDir = "${config.xdg.configHome}/zsh";
};
# version control!
git = {
enable = true;
settings = {
user = {
name = "Michael A. Perlin";
email = "mika.perlin@gmail.com";
};
init.defaultBranch = "main";
core = {
editor = "hx";
pager = "less -XF";
askpass = "";
};
fetch.prune = "true";
pull.ff = "only";
push.autoSetupRemote = "true";
credential.helper = "store";
alias = {
st = "status";
br = "branch";
co = "checkout";
cm = "commit";
aa = "!git ls-files -m -o --exclude-standard | fzf -m --print0 | xargs -0 git add";
};
};
};
# replacement for 'ls'
eza.enable = true;
eza.enableBashIntegration = true;
eza.enableZshIntegration = true;
# replacement for 'cd'
zoxide.enable = true;
zoxide.enableZshIntegration = true;
# better shell history
atuin.enable = true;
atuin.flags = [ "--disable-up-arrow" ];
};
}