-
Notifications
You must be signed in to change notification settings - Fork 1
/
home.nix
290 lines (284 loc) · 7.49 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
{
config,
pkgs,
lib,
...
}: let
isDarwin = pkgs.stdenv.isDarwin;
doomPath = "${config.home.homeDirectory}/.config/home-manager/doom";
in {
home.stateVersion = "24.11";
programs.home-manager.enable = true;
home.packages = with pkgs; [
curl
eza
fzf
gh
glow
jq
mosh
nixd
pre-commit
python312
python312Packages.ipython
ripgrep
rustup
rsync
tio
uutils-coreutils-noprefix
zoxide
];
xdg.configFile = {
# ht https://nixos-and-flakes.thiscute.world/best-practices/accelerating-dotfiles-debugging
"doom".source = config.lib.file.mkOutOfStoreSymlink doomPath;
"ghostty/config".text = ''
font-family = Berkeley Mono
font-size = 14
theme = Solarized Dark Higher Contrast
cursor-style = bar
'';
"ideavim/ideavimrc".text = ''
set clipboard+=unnamed
set relativenumber number
'';
"zed/settings.json".text = ''
{
"telemetry": {
"metrics": false
},
"theme": {
"mode": "system",
"light": "Solarized Light",
"dark": "Solarized Dark",
},
"buffer_font_size": 14,
"buffer_font_family": "Berkeley Mono",
"vim_mode": true,
"vim": {
"toggle_relative_line_numbers": true
},
"soft_wrap": "preferred_line_length",
"assistant": {
"version": "2",
"enabled": true,
"default_model": {
"provider": "ollama",
"model": "llama3.2:latest"
}
},
"auto_install_extensions": {
"git_firefly": true
}
}
'';
"zellij/layouts/minimal.kdl".text = ''
layout {
pane
pane size=1 borderless=true {
plugin location="zellij:compact-bar"
}
}
'';
};
programs = {
bat = {
enable = true;
config = {
theme = "Solarized (dark)";
pager = "less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse";
map-syntax = [".ignore:Git Ignore" "h:cpp"];
};
extraPackages = with pkgs.bat-extras; [batman];
};
btop = {
enable = true;
settings = {color_theme = "solarized_dark";};
};
direnv = {
enable = true;
nix-direnv.enable = true;
};
emacs = {
enable = true;
};
fish = {
enable = true;
plugins =
map (n: {
name = n;
src = pkgs.fishPlugins.${n}.src;
}) ["hydro" "plugin-git" "sponge" "foreign-env"]
++ [
{
name = "nix-fish";
src = pkgs.fetchFromGitHub {
owner = "kidonng";
repo = "nix.fish";
rev = "ad57d970841ae4a24521b5b1a68121cf385ba71e";
hash = "sha256-GMV0GyORJ8Tt2S9wTCo2lkkLtetYv0rc19aA5KJbo48=";
};
}
];
shellAliases = {
rm = "rm -i";
ls = "eza";
la = "eza -la";
ll = "eza -ll";
};
shellAbbrs = {ec = "emacsclient -c -a 'emacs' -nw";};
loginShellInit = "zoxide init fish | source";
interactiveShellInit =
lib.mkIf isDarwin
''
fish_add_path /opt/homebrew/bin
batman --export-env | source
'';
};
git = {
enable = true;
userName = "Cooper Pellaton";
userEmail = "[email protected]";
extraConfig = {
branch.autosetuprebase = "always";
color.ui = true;
credential.helper = "store";
diff.renames = "copies";
diff.mnemonicprefix = true;
diff.compactionHeuristic = true;
fetch.prune = true;
init.defaultBranch = "main";
merge.conflictstyle = "diff3";
push.default = "tracking";
push.autoSetupRemote = true;
rebase.autoStash = true;
rerere.enabled = 1;
submodule.recurse = true;
url = {
"ssh://[email protected]/" = {insteadOf = "https://github.com/";};
};
};
difftastic = {
enable = true;
};
lfs = {enable = true;};
};
jujutsu = {
enable = true;
settings = {
user = {
name = "Cooper Pellaton";
email = "[email protected]";
};
};
};
neovim = {
enable = true;
vimAlias = true;
defaultEditor = true;
extraConfig = ''
"""""""""""
" GENERAL "
"""""""""""
set clipboard=unnamed
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
syntax on
set t_Co=256
" Fix backspace so that it works normally
set backspace=indent,eol,start
" Show existing tab with 2 spaces width
set tabstop=2
" Copy indent from current line when starting a new line.
set autoindent
" when indenting with '>', use 2 spaces width
set shiftwidth=2
" On pressing tab, insert 2 spaces
set expandtab
" Turn case sensitive search off and smartcase search on
set ignorecase
set smartcase
" Fold based on syntax
set foldmethod=syntax
" Don't fold files by default
set nofoldenable
" Don't show the current mode on the last line (status line displays the current mode)
set noshowmode
" Limit the completion menu to 10 entries
set pumheight=10
" pres // to stop highlighting results
nmap <silent> // :nohlsearch<CR>
"""""""""""""""
" Indent Line "
"""""""""""""""
" Change the characters recursively
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
"""""""""""""""""
" WINDOW CONFIG "
"""""""""""""""""
" quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" open new split panes to right and bottom, which feels more natural
set splitbelow
set splitright
'';
plugins = with pkgs.vimPlugins; [
vim-fugitive
supertab
{
plugin = lightline-vim;
config = ''
let g:lightline = {
\ 'colorscheme': 'selenized_dark',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'FugitiveHead'
\ },
\ }
'';
}
vim-gitgutter
vim-wordmotion
vim-endwise
float-preview-nvim
{
plugin = echodoc;
config = ''
let g:echodoc#enable_at_startup = 1
let g:echodoc#type = 'floating'
" To use a custom highlight for the float window,
" change Pmenu to your highlight group
highlight link EchoDocFloat Pmenu
'';
}
tagbar
vim-smoothie
zellij-nvim
];
};
zellij = {
enable = true;
settings = {
theme = "solarized-dark";
ui = {
pane_frames = {
rounded_corners = true;
hide_session_name = true;
};
};
default_layout = "minimal";
};
};
};
# Emacs daemon
# services.emacs.enable = true;
}