-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.nix
More file actions
296 lines (266 loc) · 7.05 KB
/
home.nix
File metadata and controls
296 lines (266 loc) · 7.05 KB
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
# Home manager:
# https://nix-community.github.io/home-manager/index.xhtml
# Allows us to manage user-level configuration, the main
# nixos flake is intended for user-level configuration.
# This includes:
# - programs, config files, env vars
# - arbitrary files
# notice how it has the same layout as a module, it is a module
# and will be built together with the profile when running
# `nixos-rebuild`
# TODO: need to pass in baan differently
{
config,
pkgs,
...
}: {
home.username = "matei";
home.homeDirectory = "/home/matei";
# TODO: need an overlay for baan maybe
imports = [
./pkgs/helix.nix
./pkgs/nvim.nix
./pkgs/baan.nix
];
# TODO: separate, "homegrown" nix file
programs.baan = {
enable = true;
notesHomePath = "/home/matei/workspace/notes";
};
# Packages that should be installed to user profile
# I assume these will come automatically from nixpkgs
home.packages = with pkgs; [
fastfetch
claude-code
rustup
gcc
# archives
zip
xz
unzip
# utils
ripgrep
jq # lol always need this
eza # modern ls
fzf # CLI fuzzy finder
# unfree
_1password-cli
_1password-gui
discord
spotify
# network tools
nmap # network discovery & audit
ldns # dig replacement
socat # replacement for netcat
# GNU
tree
gnused
gnutar
gawk
gnupg # privacy guard
# Misc
glow # markdown preview in terminal
btop # htop/nmon replacement
iftop # netw monitoring
# Sys monitoring
strace
lsof
# Sys tools
lm_sensors # for `sensors` command
usbutils # lsusb
sysstat
# Nix stuff
# provides a `nom` command that works just like `nix` with more
# details log output
nix-output-monitor
# spotify
# Serial
screen
minicom
# D-Bus stuff
d-spy
man-pages
man-pages-posix
linux-manual
# Nix
nixd
];
programs.git = {
enable = true;
userName = "comradeshr00m";
userEmail = "typedfrog@proton.me";
aliases = {
st = "status";
co = "checkout";
};
delta.enable = true;
extraConfig = {
init.defaultBranch = "main";
};
};
home.sessionVariables = {
TERMINAL = "ghostty";
FZF_DEFAULT_COMMAND = "rg --files --hidden";
};
home.sessionPath = [
"$HOME/.local/bin"
"$HOME/.cargo/bin"
];
home.shellAliases = {
g = "git";
gst = "git status";
la = "eza -la --icons --colour-scale";
ll = "eza -abghHli --icons";
ls = "eza --icons";
tree = "eza --tree";
nb = "nix build";
nd = "nix develop";
nf = "nix flake";
nflake = "command nix flake";
ns = "nix shell";
# TODO(@mdavid): should receive the path from args
nswitch = "nixos-rebuild switch --flake $HOME/workspace/dotfiles --use-remote-sudo && exec $SHELL -l";
pbcopy = "wl-copy";
pbpaste = "wl-paste";
};
programs.starship = {
enable = true;
settings = {
format = "$username$directory$git_branch$git_state$git_status$cmd_duration$line_break$jobs$character";
directory = {
truncation_length = 1;
truncation_symbol = "";
fish_style_pwd_dir_length = 1;
style = "blue";
};
username = {
format = "[$user ]($style)";
style_user = "bold #eb6f92";
};
character = {
success_symbol = "[:;](bold green)";
error_symbol = "[:;](bold red)";
};
jobs = {
symbol = "✦ ";
number_threshold = 2;
symbol_threshold = 1;
};
git_branch = {
format = "[$branch]($style)";
symbol = " ";
style = "bright-black";
};
cmd_duration = {
format = "[$duration]($style) ";
style = "yellow";
};
git_status = {
style = "cyan";
conflicted = "";
untracked = "";
modified = "";
staged = "";
renamed = "";
deleted = "";
stashed = "≡";
format = "[([*$conflicted$untracked$modified](218) $ahead_behind$stashed)]($style) ";
ahead = "⇡\${count}";
behind = "⇣\${count}";
diverged = "⇕⇡\${ahead_count}⇣\${behind_count}";
};
git_state = {
format = "([$state( $progress_current/$progress_total)]($style)) ";
style = "bright-black";
};
};
};
programs.ghostty = {
enable = true;
};
xdg.configFile."ghostty".source = config.lib.file.mkOutOfStoreSymlink ./ghostty;
# https://search.nixos.org/options
programs.zsh = {
enable = true;
enableCompletion = true;
initContent = ''
# helper function that returns 0 if `nom` should be used for
# command output.
# supported: `nix build|develop|shell|run` and `nix flake check|build`
_use_nom() {
case "$1" in
build|develop|shell|run) return 0 ;;
flake)
case "$2" in
check|build) return 0 ;;
*) return 1 ;;
esac
;;
*) return 1 ;;
esac
}
# pipe output through `nom` if available on $PATH
nix() {
if command -v nom >/dev/null 2>&1 && _use_nom "$@"; then
command nix "$@" |& nom
else
command nix "$@"
fi
}
'';
# initExtra = builtins.readFile .zshrc
};
programs.zellij = {
enable = true;
#enableZshIntegration = true;
settings = {
# theme = "catppuccin-mocha";
theme = "tokyo-night-storm";
mouse_mode = true;
};
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.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 = "24.11";
xdg = {
enable = true;
# XDG_CONFIG_HOME
configHome = "${config.home.homeDirectory}/.config";
# XDG_DATA_HOME
dataHome = "${config.home.homeDirectory}/.local/share";
# XDG_CACHE_HOME
cacheHome = "${config.home.homeDirectory}/.cache";
# XDG_STATE_HOME
stateHome = "${config.home.homeDirectory}/.local/state";
};
# Let home Manager install and manage itself.
programs.home-manager.enable = true;
}
# link the configuration file in current directory to the specified location in home directory
# home.file.".config/i3/wallpaper.jpg".source = ./wallpaper.jpg;
# link all files in `./scripts` to `~/.config/i3/scripts`
# home.file.".config/i3/scripts" = {
# source = ./scripts;
# recursive = true; # link recursively
# executable = true; # make all files executable
# };
# encode the file content in nix configuration file directly
# home.file.".xxx".text = ''
# xxx
# '';
# set cursor size and dpi for 4k monitor
# xresources.properties = {
# "Xcursor.size" = 16;
# "Xft.dpi" = 172;
# };