-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
257 lines (242 loc) · 5.93 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
{
pkgs,
lib,
...
}: let
nixGLWrap = pkg:
pkgs.runCommand "${pkg.name}-nixgl-wrapper" {} ''
mkdir $out
ln -s ${pkg}/* $out
rm $out/bin
mkdir $out/bin
for bin in ${pkg}/bin/*; do
wrapped_bin=$out/bin/$(basename $bin)
echo "exec ${lib.getExe' pkgs.nixgl.auto.nixGLDefault "nixGL"} $bin \"\$@\"" > $wrapped_bin
chmod +x $wrapped_bin
done
'';
# catppuccin mocha colors
themeColors = {
rosewater = "#f5e0dc";
flamingo = "#f2cdcd";
pink = "#f5c2e7";
mauve = "#cba6f7";
red = "#f38ba8";
maroon = "#eba0ac";
peach = "#fab387";
yellow = "#f9e2af";
green = "#a6e3a1";
teal = "#94e2d5";
sky = "#89dceb";
sapphire = "#74c7ec";
blue = "#89b4fa";
lavender = "#b4befe";
text = "#cdd6f4";
subtext1 = "#bac2de";
subtext0 = "#a6adc8";
overlay2 = "#9399b2";
overlay1 = "#7f849c";
overlay0 = "#6c7086";
surface2 = "#585b70";
surface1 = "#45475a";
surface0 = "#313244";
base = "#1e1e2e";
mantle = "#181825";
crust = "#11111b";
};
in {
home.username = "tangtang";
home.homeDirectory = "/home/tangtang";
home.stateVersion = "23.11";
home.keyboard = {
layout = "us";
};
home.packages = [
# new coreutils
pkgs.ripgrep
pkgs.ripgrep-all
pkgs.fd
pkgs.bat
pkgs.bottom
pkgs.du-dust
pkgs.sd
pkgs.procs
pkgs.tailspin
# web tools
pkgs.wget
pkgs.httpie
pkgs.termscp
pkgs.dogdns
pkgs.bandwhich
# file processors
pkgs.jq
pkgs.jqp
pkgs.yq
pkgs.zip
pkgs.unzip
pkgs.hexyl
# text editors
pkgs.vim
pkgs.delta
# languages
pkgs.rust-bin.stable.latest.complete
(pkgs.python3.withPackages (ps: with ps; [pip]))
(pkgs.lua.withPackages (ps: with ps; [jsregexp]))
pkgs.gnumake
pkgs.nodejs
pkgs.unstable.zig
pkgs.go
# cargo packages
pkgs.cargo-llvm-cov
pkgs.cargo-cross
# language tools
pkgs.tree-sitter
# formatters
pkgs.alejandra
# dap (debugger tool)
pkgs.vscode-extensions.vadimcn.vscode-lldb
# others
pkgs.fzf
pkgs.neofetch
pkgs.tokei
pkgs.tealdeer
pkgs.xclip
pkgs.xdg-utils
pkgs.watchexec
(pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];})
# guis
pkgs.nixgl.auto.nixGLDefault
(nixGLWrap pkgs.wineWowPackages.full)
(nixGLWrap pkgs.firefox) # must have a browser installed with nix as default browser
(nixGLWrap pkgs.gimp)
(nixGLWrap pkgs.spotify)
(nixGLWrap pkgs.discord)
(nixGLWrap pkgs.onlyoffice-bin)
(nixGLWrap pkgs.vlc)
(nixGLWrap pkgs.whatsapp-for-linux) # need to disable hardware acceleration
(nixGLWrap pkgs.via) # for keychron keyboard
];
home.sessionVariables = {
EDITOR = "nvim";
LD_LIBRARY_PATH = ""; # to fix libgc issue with alacritty
};
# set pointer cursor due to tiny icon when using scaling
home.pointerCursor = {
name = "Pop";
package = pkgs.pop-icon-theme;
size = 32;
};
# zellij static config file (because limitation in nix to kdl converter)
xdg.configFile."zellij/config.kdl".source = ./config/zellij.kdl;
# enable user fonts
fonts.fontconfig.enable = true;
programs = {
home-manager.enable = true;
fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
'';
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
eza = {
enable = true;
icons = "auto";
};
zoxide = {
enable = true;
};
starship = {
enable = true;
enableFishIntegration = true;
};
zellij = {
enable = true;
enableFishIntegration = true;
};
broot = {
enable = true;
};
yazi = {
enable = true;
enableFishIntegration = true;
};
git = import ./programs/git.nix;
lazygit = {
enable = true;
settings = {
gui = {
theme = {
activeBorderColor = [themeColors.blue "bold"];
inactiveBorderColor = [themeColors.subtext0];
optionsTextColor = [themeColors.blue];
selectedLineBgColor = [themeColors.surface0];
cherryPickedCommitBgColor = [themeColors.surface1];
cherryPickedCommitFgColor = [themeColors.blue];
unstagedChangesColor = [themeColors.red];
defaultFgColor = [themeColors.text];
searchingActiveBorderColor = [themeColors.yellow];
};
authorColors = {
"Tangtang Zhou" = themeColors.mauve;
"*" = themeColors.lavender;
};
};
};
};
neovim = {
enable = true;
defaultEditor = true;
vimAlias = true;
};
gnome-shell = {
enable = true;
extensions = with pkgs.gnome42.gnomeExtensions; [
{package = clipboard-indicator;}
];
};
};
# gui programs
programs = {
alacritty = (import ./programs/alacritty.nix) {
inherit pkgs;
inherit themeColors;
inherit nixGLWrap;
};
thunderbird = {
enable = true;
package = nixGLWrap pkgs.thunderbird;
profiles = {
default = {
isDefault = true;
};
};
};
};
# only gnome settings (for pop-os)
dconf.settings = {
"org/gnome/desktop/input-sources" = {
xkb-options = ["caps:swapescape"];
};
"org/gnome/desktop/wm/keybindings" = {
move-to-workspace-1 = ["<Shift><Super>1"];
move-to-workspace-2 = ["<Shift><Super>2"];
move-to-workspace-3 = ["<Shift><Super>3"];
move-to-workspace-4 = ["<Shift><Super>4"];
switch-to-workspace-1 = ["<Super>1"];
switch-to-workspace-2 = ["<Super>2"];
switch-to-workspace-3 = ["<Super>3"];
switch-to-workspace-4 = ["<Super>4"];
};
"org/gnome/desktop/applications/terminal" = {
exec = "alacritty";
exec-arg = "";
};
"org/gnome/shell/extensions/clipboard-indicator" = {
toggle-menu = ["<Super>p"];
};
};
}