-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
311 lines (294 loc) · 8.06 KB
/
home.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
{ config, pkgs, ... }:
{
# Fix application links in Gnome
# https://github.com/nix-community/home-manager/issues/1439#issuecomment-714830958
targets.genericLinux.enable = true;
xdg.enable = true;
xdg.mime.enable = true;
home.packages = with pkgs; [
ark
bat
chromium
clisp
cloc
cloc
discord
dive
exa
fd
fzf
git
glxinfo
htop
jq
killall
libreoffice
libxml2
lispPackages.quicklisp
mpv
nomacs
nyxt
p7zip
pciutils
pgcli
postman
procs
quickemu
quickemu
ripgrep
ripgrep-all
sbcl
spice-gtk # needed for `spicy` which quickemu uses
spotify
tdesktop
tealdeer
traceroute
transmission-gtk
tree
units
unzip
vlc
whois
xclip
yt-dlp
];
home.file.".config/discord/settings.json" = {
text = ''
{
"SKIP_HOST_UPDATE": true
}
'';
};
home.file.".config/ripgreprc" = {
source = ./dotfiles/ripgreprc;
};
home.file.".config/work.sh" = {
source = ./dotfiles/work.sh;
};
programs.bash = {
enable = true;
historyControl = [
"ignoredups"
"ignorespace"
];
initExtra = builtins.readFile ./dotfiles/bashrc;
shellAliases = {
ls = "exa";
ll = "exa -al --classify";
la = "exa -a";
lt = "exa --tree";
lr = "exa -l --classify --sort modified --reverse --color always | head";
".." = "cd ..";
gits = "git s";
nixos-rebuild = "nixos-rebuild --flake . --use-remote-sudo";
};
shellOptions = [
"checkwinsize"
"globstar"
"histappend"
];
};
programs.emacs = {
enable = true;
extraConfig = builtins.readFile ./dotfiles/emacs/init.el;
extraPackages = emacsPackages: with emacsPackages; [
backward-forward
evil
golden-ratio-scroll-screen
helm
meow
nix-mode
org-pdftools
pdf-tools
slime
];
};
programs.lesspipe.enable = true;
programs.firefox = {
enable = true;
profiles = {
"ken" = {
id = 0;
isDefault = true;
extraConfig = ""; # TODO: user.js goes here
userChrome = ""; # TODO: userChrome.css goes here
userContent = ""; # TODO: userContent.css goes here
settings = {
"browser.urlbar.clickSelectsAll" = true;
"browser.urlbar.doubleClickSelectsAll" = false;
"browser.tabs.tabMinWidth" = 0;
"general.autoScroll" = true;
# Restore tabs automatically
"browser.startup.page" = 3;
# Don't warn about closing tabs
"browser.tabs.warnOnClose" = false;
# Don't cycle tabs in MRU order
"browser.ctrlTab.recentlyUsedOrder" = false;
# Allow DRMed content
"media.eme.enabled" = true;
# Disable Pocket
# Note: Still has to be manually removed from the homepage
# See about:preferences#home
"extensions.pocket.enabled" = false;
#Don't offer to save passwords
"signon.rememberSignons" = false;
"https-only-mode-setting" = true;
# Faster Pageload needs these
"network.dns.disablePrefetchFromHTTPS" = false;
"network.predictor.enable-prefetch" = true;
};
};
};
};
programs.git = {
enable = true;
userName = "Ken Klatt";
userEmail = "[email protected]"; # TODO: Make this conditional for work email
aliases = {
co = "checkout";
cp = "cherry-pick";
s = "status";
sw = "switch";
d = "diff";
ds = "diff --staged";
# diff with the active branch's upstream
du = ''
!f() { \
git diff `git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"`; \
}; f
'';
b = "branch";
ba = "branch -a";
br = "branch -r";
# Shows branches in recently-committed-to order
brecent = "for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'";
# Used with vim like this: vim $(git conflicts) to open all conflicted files
conflicts = "diff --name-only --diff-filter=U";
# Stage just the whitespace changes
addwhitespace = "! git add -A && git diff --cached -w | git apply --cached -R";
# Used to 'cd `git root`' quickly
root = "rev-parse --show-toplevel";
fix = "commit --amend --no-edit";
upstream = ''
!f() { \
echo `git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)"`; \
}; f
'';
merge-base = "merge-base"; # This is here for tab completion to find the command. It's part of the plumbing.
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
lga = "lg --all"; # Include commits from all branches
lightweight-tags = ''
!f() { \
git for-each-ref refs/tags/ --format '%(objecttype) %(refname:short)' | while read ty name; do [ $ty = commit ] && echo $name; done \
}; f
'';
annotated-tags = ''
!f() { \
git for-each-ref refs/tags/ --format '%(objecttype) %(refname:short)' | while read ty name; do [ $ty = tag ] && echo $name; done \
}; f
'';
remote-tags = "ls-remote --tags origin";
};
delta = {
enable = false;
options = {
decorations = {
commit-decoration-style = "bold yellow box ul";
file-decoration-style = "none";
file-style = "bold yellow ul";
};
features = "decorations";
whitespace-error-style = "22 reverse";
};
};
extraConfig = {
pull = {
rebase = true;
ff = "only";
};
merge = {
ff = false;
};
core = {
# -+F: Configure the pager git uses for diffs to not exit automatically on short
# content so that I stop closing my terminal trying to scroll down with ctrl-d.
# -j.5: When searching have less put the result in the middle of the screen, not the top.
pager = "less -+F -j.5";
};
clean = {
requireForce = false;
};
fetch = {
prune = true;
};
push = {
default = "current";
followTags = true;
atomic = true;
};
commit = {
# Show the diff when editing the commit message
verbose = true;
};
log = {
follow = true;
};
diff = {
noprefix = true;
};
init = {
defaultBranch = "main";
};
};
ignores = [
"*.swp"
"*~"
".idea/*"
"result"
];
};
programs.tmux = {
enable = true;
keyMode = "vi";
newSession = true;
baseIndex = 1;
clock24 = false;
customPaneNavigationAndResize = true;
escapeTime = 0;
sensibleOnTop = true;
plugins = with pkgs; [
{
plugin = tmuxPlugins.resurrect;
extraConfig = "set -g @resurrect-strategy-vim 'session'";
}
{
plugin = tmuxPlugins.fingers;
}
];
extraConfig = builtins.readFile ./dotfiles/tmux.conf;
};
programs.vim = {
enable = true;
plugins = with pkgs.vimPlugins; [
Improved-AnsiEsc
surround
vim-nix
];
extraConfig = builtins.readFile ./dotfiles/vimrc;
};
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "ken";
home.homeDirectory = "/home/ken";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
}