-
Notifications
You must be signed in to change notification settings - Fork 1
/
home.nix
370 lines (348 loc) · 9.04 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
{ config, pkgs, ... }:
# github.com/fmoda3/nix-configs: home/nvim/
let
nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { inherit pkgs; };
unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
config = import ./config.nix;
useWayland = config.useWayland;
thinkpad = config.thinkpad;
graphical = config.graphical;
in
{
nixpkgs.config.allowUnfree = true;
home = {
# Home Manager needs a bit of information about you and the
# paths it should manage.
username = "kronicmage";
homeDirectory = "/home/kronicmage";
# 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.
stateVersion = "22.11";
packages = with pkgs; [
pinentry
gopass
gopass-jsonapi
binwalk
neofetch
ripgrep
fd
fzy
unzip
unrar
rlwrap
zip
mosh
todoist
]
++ (if graphical then [
unstable.discord
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
pavucontrol
font-awesome
zathura
chromium
libreoffice
caprine-bin
gnome.eog
todoist-electron
] ++ (if useWayland then [
grim
slurp
wl-clipboard
bemenu
] else [
xclip
]) else [ ])
++ (if thinkpad then [
light
] else [ ])
;
# TODO: programs.neovim.defaultEditor merged end of 2022, check for updates
sessionVariables = {
EDITOR = "nvim";
VISUAL = "nvim";
};
};
services.gpg-agent = {
enable = true;
pinentryFlavor = if graphical then "gtk2" else "tty";
enableFishIntegration = true;
};
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
exa = {
enable = true;
enableAliases = 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 = "contact@simonzeng.com";
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; # TODO: merged end of 2022, check for updates
plugins = with pkgs.vimPlugins; [
# focus-nvim
comment-nvim
coq-artifacts
coq_nvim
dhall-vim
dressing-nvim
gitsigns-nvim
gruvbox-nvim
haskell-tools-nvim
haskell-vim
indent-blankline-nvim
leap-nvim
lsp-status-nvim
lsp_extensions-nvim
lspkind-nvim
nvim-autopairs
nvim-colorizer-lua
nvim-lspconfig
nvim-tree-lua
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-treesitter.withAllGrammars
nvim-ts-rainbow
nvim-web-devicons
parinfer-rust
purescript-vim
stabilize-nvim
telescope-fzy-native-nvim
telescope-nvim
telescope-symbols-nvim
telescope-ui-select-nvim
vim-endwise
vim-repeat
vim-sexp
vim-sexp-mappings-for-regular-people
vim-surround
vimagit
vimtex
vista-vim
which-key-nvim
];
# only loaded when neovim is launched!
extraPackages = with pkgs; [
# lsp
clojure-lsp
cmake-language-server
docker-ls
haskellPackages.dhall-lsp-server
haskellPackages.haskell-language-server
java-language-server
kotlin-language-server
metals
nodePackages.bash-language-server
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
nodePackages.yaml-language-server
ocamlPackages.ocaml-lsp
pyright
rnix-lsp
rust-analyzer
statix
sumneko-lua-language-server
texlab
# formatters
black
nixpkgs-fmt
ocamlformat
ocamlPackages.ocamlformat-rpc-lib
];
};
} // (if graphical then {
mpv.enable = true; # media player
mako.enable = useWayland; # wayland notification daemon
firefox =
{
enable = true;
package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
extraPolicies = {
ExtensionSettings = { };
};
};
extensions = with nur.repos.rycee.firefox-addons; [
ublock-origin
vimium
gopass-bridge
anonaddy
darkreader
];
profiles.default = {
id = 0;
name = "Default";
isDefault = true;
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;
};
};
};
kitty = {
enable = true;
font.name = "JetBrainsMono Nerd Font";
font.size = if thinkpad then 13 else 16;
theme = "Gruvbox Dark";
};
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 then {
services.random-background = {
enable = true;
imageDirectory = "%h/.config/nixpkgs/backgrounds";
};
} 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 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;
};
};
};
} else { })