-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
420 lines (381 loc) · 9.67 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
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
{
pkgs,
lib,
repos,
...
}: let
onePassPath = "~/.1password/agent.sock";
in {
programs.home-manager.enable = true;
programs.ghostty = {
enable = true;
package = repos.ghostty.packages.${pkgs.system}.default;
settings = {
background-blur-radius = 20;
minimum-contrast = 1.1;
font-family = "DroidSansM Nerd Font Mono";
window-decoration = false;
};
};
programs.bat.enable = true;
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.waybar = {
enable = true;
};
home.packages = with pkgs; [oh-my-zsh chroma fd wgnord];
stylix = {
targets = {
rofi.enable = true;
mako.enable = true;
neovim.enable = true;
gtk.enable = true;
ghostty.enable = true;
};
};
programs.rofi = {
enable = true;
terminal = "ghostty";
};
services.mako = {
enable = true;
defaultTimeout = 2500;
borderRadius = 10;
};
systemd.user.services.wgnord = {
Unit = {
Description = "WireGuard NordVPN connection manager";
After = ["network-online.target"];
Wants = ["network-online.target"];
};
Service = {
ExecStart = "${pkgs.wgnord}/bin/wgnord connect";
Restart = "always";
RestartSec = "30";
};
Install = {
WantedBy = ["default.target"];
};
};
# systemd.user.services.swww = {
# Unit = {
# Description = "SWWW wallpaper daemon";
# PartOf = [ "graphical-session.target" ];
# };
# Service = {
# ExecStart = "${pkgs.swww}/bin/swww-daemon";
# Restart = "on-failure";
# };
# Install = {
# WantedBy = [ "graphical-session.target" ];
# };
# };
# Create a script to set the wallpaper
home.file.".local/bin/set-wallpaper" = {
executable = true;
text = ''
#!/usr/bin/env bash
if pgrep swww-daemon >/dev/null; then
swww img ${./resources/strikefreedom_small.gif}
else
(swww-daemon 1>/dev/null 2>/dev/null &) && swww img ${./resources/strikefreedom_small.gif}
fi
'';
};
wayland.windowManager.hyprland = {
enable = true;
extraConfig = ''
device {
name=logitech-usb-receiver
sensitivity=0.6
}
'';
settings = {
"$mod" = "SUPER";
monitor = [
"eDP-2,2880x1800@120,0x0,1"
",highres,2880x0,0.625000"
];
general = {
gaps_in = 5;
gaps_out = 10;
border_size = "1";
layout = "dwindle";
};
input = {
kb_options = "ctrl:nocaps";
};
animation = ["global,0"];
decoration = {
# See https://wiki.hyprland.org/Configuring/Variables/ for more
inactive_opacity = 0.7;
#shadow_offset = "-7 -7";
rounding = 15;
blur = {
enabled = true;
xray = true;
size = 4;
passes = 1;
new_optimizations = true;
};
#drop_shadow = "yes";
shadow = {
range = 30;
render_power = 4;
enabled = true;
};
};
exec-once = [
"${pkgs.mako}/bin/mako &"
"${pkgs.waybar}/bin/waybar &"
];
bind =
[
"$mod, m, exec, ${pkgs.rofi-wayland}/bin/rofi -show drun -show-icons"
"$mod, SPACE, exec, ${repos.ghostty.packages.${pkgs.system}.default}/bin/ghostty"
"$mod, f, fullscreen,"
"$mod, w, killactive"
"$mod, h, movefocus, l"
"$mod, j, movefocus, d"
"$mod, k, movefocus, u"
"$mod, l, movefocus, r"
]
++ (
builtins.concatLists (builtins.genList (
x: let
ws = let
c = (x + 1) / 10;
in
builtins.toString (x + 1 - (c * 10));
in [
"$mod, ${ws}, workspace, ${toString (x + 1)}"
"$mod SHIFT, ${ws}, movetoworkspace, ${toString (x + 1)}"
]
)
10)
);
};
};
programs.hyprlock.enable = true;
#xdg.configFile."alacritty/alacritty.toml".source = ./config/alacritty/alacritty.toml;
#xdg.configFile."ironbar/config.corn".source = ./config/ironbar/config.corn;
programs.foot = {
enable = true;
};
programs.alacritty = {
enable = true;
settings = {
#font.normal = "DroidSansM Nerd Font Mono";
keyboard.bindings = [
{
action = "Copy";
key = "C";
mods = "Control|Shift";
}
{
action = "Paste";
key = "V";
mods = "Control|Shift";
}
];
};
};
xdg.configFile.nvim = {
source = ./config/nvim;
recursive = true;
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
defaultEditor = true;
withPython3 = true;
#extraConfig = ''
# :luafile ~/.config/nvim/init.lua
#'';
plugins = with pkgs.vimPlugins;
[
base16-nvim
copilot-vim
catppuccin-nvim
cmp-nvim-lsp
cmp-nvim-lsp-signature-help
cmp-nvim-lsp-document-symbol
dressing-nvim
haskell-tools-nvim
mini-diff
mini-pick
nvim-cmp
nvim-treesitter.withAllGrammars
nvim-lspconfig
plenary-nvim
rustaceanvim
telescope-nvim
telescope-undo-nvim
telescope-ui-select-nvim
telescope-file-browser-nvim
lsp-zero-nvim
vim-fugitive
lualine-nvim
nui-nvim
nvim-dap-ui
nvim-dap-virtual-text
which-key-nvim
none-ls-nvim
snacks-nvim
trouble-nvim
vim-expand-region
]
++ [
(pkgs.vimUtils.buildVimPlugin {
pname = "codecompanion.nvim";
version = "1";
src = repos.codecompanion-nvim;
propagatedBuildInputs = with pkgs.vimPlugins; [plenary-nvim mini-diff mini-pick telescope-nvim];
dependencies = with pkgs.vimPlugins; [plenary-nvim mini-diff mini-pick telescope-nvim];
prePatch = ''
# Create empty minimal.lua to avoid initialization during build
cat > lua/minimal.lua << EOF
return {}
EOF
# Create empty constants.lua
mkdir -p lua/codecompanion
cat > lua/codecompanion/constants.lua << EOF
return {
-- Add any necessary constants here
CODE_LENS_NS = "codecompanion_lens",
VIRTUAL_TEXT_NS = "codecompanion_vt",
DIAGNOSTICS_NS = "codecompanion_diagnostics",
}
EOF
# Create empty static.lua if needed
cat > lua/codecompanion/actions/static.lua << EOF
local M = {}
M.actions = {}
return M
EOF
'';
})
(pkgs.vimUtils.buildVimPlugin {
pname = "render-markdown-nvim";
version = "1";
src = repos.render-markdown-nvim;
})
];
};
programs.git = {
enable = true;
userName = "drawnwren";
userEmail = "drawnwren@gmail.com";
extraConfig = {
push = {
autoSetupRemote = true;
};
safe = {directory = "/etc/nixos";};
gpg = {
format = "ssh";
};
"gpg \"ssh\"" = {
program = "${lib.getExe' pkgs._1password-gui "op-ssh-sign"}";
};
};
};
xdg.mimeApps.defaultApplications = {
"text/plain" = ["neovide.desktop"];
"applications/pdf" = ["zathura.desktop"];
"image/*" = ["sxiv.desktop"];
"video/png" = ["mpv.desktop"];
"video/jpg" = ["mpv.desktop"];
"video/*" = ["mpv.desktop"];
};
programs.starship = {
enable = true;
enableZshIntegration = true;
};
programs = {
direnv = {
enable = true;
enableBashIntegration = true; # see note on other shells below
enableZshIntegration = true;
nix-direnv.enable = true;
};
};
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
enableCompletion = false;
autosuggestion.enable = true;
history = {
expireDuplicatesFirst = true;
extended = true;
ignoreDups = true;
ignoreSpace = true;
save = 10000;
share = true;
size = 10000;
};
plugins = [
{
name = "fzf-tab";
src = pkgs.fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "c2b4aa5ad2532cca91f23908ac7f00efb7ff09c9";
sha256 = "1b4pksrc573aklk71dn2zikiymsvq19bgvamrdffpf7azpq6kxl2";
};
}
];
initExtra = ''
${(builtins.readFile ./config/zsh/.zshrc)}
# Configure fzf to show above prompt
export FZF_DEFAULT_OPTS="--height 40% --layout=reverse --border"
# Enable fzf keybindings for zsh
bindkey '^T' fzf-file-widget
bindkey '^R' fzf-history-widget
bindkey '^I' fzf-completion
# Enable fzf completion
zstyle ':completion:*' fzf-search-display true
'';
oh-my-zsh = {
enable = true;
plugins = [
"git"
"colorize"
"colored-man-pages"
"dirpersist"
"fzf"
"wd"
"colorize"
"history"
"rust"
"pyenv"
];
#theme = "cypher";
};
};
programs.ssh = {
enable = true;
extraConfig = ''
Host *
IdentityAgent ${onePassPath}
'';
};
programs.chromium = {
enable = true;
};
home.sessionVariables = {
XCURSOR_SIZE = "24";
GDK_SCALE = "1";
# Force Xwayland apps to use monitor's scale factor
GDK_DPI_SCALE = "1";
# For Qt applications
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
# For legacy X11 apps
XWAYLAND_SCALE = "1";
NIXOS_OZONE_WL = "1";
};
home.stateVersion = "24.05";
}