-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome.nix
387 lines (363 loc) · 8.68 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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
{ config, lib, pkgs, username, stateVersion, homeDirectory, nur, system, ... }:
let
nurNopkgs = import nur { pkgs = pkgs; nurpkgs = pkgs; };
allowUnfree = config.allowUnfree;
useWayland = config.useWayland;
thinkpad = config.thinkpad;
graphical = config.graphical;
in
{
nixpkgs.config.allowUnfree = allowUnfree;
home = {
stateVersion = stateVersion;
username = username;
homeDirectory = homeDirectory;
packages = with pkgs; [
stow
dust
gopass
gopass-jsonapi
binwalk
neofetch
ripgrep
fd
fzy
unzip
unrar
rlwrap
zip
mosh
todoist
rclone
wget
killall
(python3.withPackages (ps: with ps; [
requests
pynvim
]))
]
++ (if graphical then [
# pulseaudioFull
slack
# webex
openconnect
# discord
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
font-awesome
zathura
caprine-bin
eog
liberation_ttf
geogebra
neovide
] ++ (if useWayland then [
grim
slurp
wl-clipboard
bemenu
] else [
]) else [ ])
++ (if thinkpad then [
usbutils
light
xclip
xmlstarlet
lxappearance
paprefs
] else [ ])
++ (if graphical && thinkpad then [
qFlipper
todoist-electron
fractal
libreoffice
pinentry-gtk2
citrix_workspace
chromium
pavucontrol
nemo
calibre
zoom
] else if graphical then [
pinentry_mac
] else [ pinentry ])
;
};
xdg.configFile.nvim = {
source = ./nvim;
recursive = true;
};
programs = {
# Let Home Manager install and manage itself.
home-manager.enable = true;
# no config programs
tealdeer.enable = true; # tldr
gpg.enable = true;
fish.enable = true; # shell replacement
bottom.enable = true; # htop replacement
# ls replacement
eza = {
enable = true;
enableFishIntegration = true;
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
# shell prompt manager
starship = {
enable = true;
enableFishIntegration = true;
settings = {
character = {
success_symbol = "[>>=](bold green)";
error_symbol = "[_|_](bold red)";
vicmd_symbol = "[<*>](bold green)";
};
python.detect_extensions = [ ];
};
};
# quick shell navigation
zoxide = {
enable = true;
enableFishIntegration = true;
};
git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
userName = "Simon Zeng";
userEmail = "[email protected]";
extraConfig = {
core.editor = "nvim";
credential.helper = "store";
};
signing = {
key = "973C9963CA528797";
signByDefault = true;
};
};
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
withPython3 = true;
defaultEditor = true;
plugins = with pkgs.vimPlugins; [
# the goat
mini-nvim
# util
leap-nvim
vim-endwise
vim-repeat
# git
git-blame-nvim
gitsigns-nvim
neogit
# appearance
dressing-nvim
gruvbox-nvim
nvim-web-devicons
stabilize-nvim
# ide features
lsp-status-nvim
lsp_extensions-nvim
lsp_lines-nvim
lspkind-nvim
nvim-dap
nvim-dap-python
nvim-dap-ui
nvim-lspconfig
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-treesitter.withAllGrammars
rainbow-delimiters-nvim
vista-vim
# language specific
dhall-vim
# haskell-tools-nvim
haskell-vim
# parinfer-rust
purescript-vim
typescript-tools-nvim
# vim-sexp
# vim-sexp-mappings-for-regular-people
vimtex
neodev-nvim
];
# only loaded when neovim is launched!
extraPackages = with pkgs; [
# lsp
clojure-lsp
cmake-language-server
docker-ls
# dhall-lsp-server
haskell-language-server
java-language-server
kotlin-language-server
metals
nil
nodePackages.bash-language-server
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server
ocamlPackages.ocaml-lsp
pyright
statix
lua-language-server
texlab
typescript
# formatters
black
ruff
ruff-lsp
nixpkgs-fmt
ocamlformat
ocamlPackages.ocamlformat-rpc-lib
];
};
} // (if graphical then {
mpv.enable = true; # media player
kitty = {
enable = true;
font.name = "JetBrainsMono Nerd Font";
font.size = if thinkpad then 13 else 16;
theme = "Gruvbox Dark";
};
} else { });
} // (if graphical && thinkpad then {
services.mako.enable = useWayland; # wayland notification daemon
firefox =
{
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
ExtensionSettings = { };
};
};
profiles.default = {
id = 0;
name = "Default";
isDefault = true;
extensions = with nurNopkgs.repos.rycee.firefox-addons; [
ublock-origin
vimium
gopass-bridge
addy_io
darkreader
];
settings = {
"browser.theme.content-theme" = 0; # dark theme
"browser.theme.toolbar-theme" = 0; # dark theme
"findbar.modalHighlight" = true; # dims screen and animates during ctrl-f
"findbar.highlightAll" = true; # highlights all ctrl-f results
"browser.newtabpage.activity-stream.enabled" = false; # better new tab
"extensions.pocket.enabled" = false; # disable pocket
"browser.compactmode.show" = true;
"identity.fxaccounts.enabled" = false;
};
};
};
i3status = {
enable = true;
enableDefault = false;
general = {
interval = 1;
colors = true;
color_good = "#b8bb26";
color_bad = "#fb4934";
color_degraded = "#fabd2f";
};
modules = {
"volume master" = {
position = 1;
settings = {
format = "%volume ";
format_muted = " ";
device = "default";
mixer = "Master";
mixer_idx = 0;
};
};
"wireless wlp2s0" = {
position = 2;
settings = {
format_up = "%quality %essid %ip";
format_down = "";
};
};
"battery 0" = {
position = 3;
settings = {
format = "%status %percentage %consumption %remaining";
format_down = "";
last_full_capacity = true;
integer_battery_capacity = true;
low_threshold = 11;
threshold_type = "percentage";
hide_seconds = true;
status_chr = " ";
status_bat = " ";
status_unk = " ";
status_full = " ";
};
};
"tztime local" = {
position = 4;
settings = {
format = " %I:%M %p";
};
};
};
};
} else { })
// (if graphical && useWayland then {
wayland.windowManager.sway =
{
enable = true;
wrapperFeatures.gtk = true;
config = {
modifier = "Mod4";
gaps = {
inner = 10;
outer = 0;
smartGaps = true;
};
input =
if thinkpad then {
"2:10:TPPS/2_Elan_TrackPoint".tap = "enabled";
"1739:0:Synaptics_TM3289-021".tap = "enabled";
} else { };
terminal = "kitty";
output = {
"*" = {
bg = "~/.config/nixpkgs/backgrounds/cozywindow.jpg fill";
};
};
};
};
} else if thinkpad && graphical && !useWayland then {
xsession.windowManager.i3 = {
enable = true;
package = pkgs.i3-gaps; # TODO: remove when merger hits
config = {
terminal = "kitty";
modifier = "Mod4";
window.hideEdgeBorders = "smart";
workspaceAutoBackAndForth = true;
gaps = {
inner = 10;
outer = 0;
smartGaps = true;
};
window.commands = [{ criteria = { title = "HearthstoneOverlay"; }; command = "sticky enable"; }];
};
};
} else { })
// (if thinkpad then {
services.gpg-agent = {
enable = true;
pinentryFlavor = if graphical then "gtk2" else "tty";
enableFishIntegration = true;
};
}
else { })