-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
365 lines (335 loc) · 8.64 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
{ pkgs, ... }:
let
oci-cli = pkgs.oci-cli.overridePythonAttrs (old: rec {
inherit (old) pname;
version = "3.50.1";
src = pkgs.fetchFromGitHub {
owner = "oracle";
repo = pname;
rev = "v${version}";
hash = "sha256-qSXIHEdNIfEPDsXIeHqfl49yjnQ320EiVNRapBQX4vQ=";
};
});
in
{
home = {
stateVersion = "23.11";
sessionPath = [ "$HOME/.go/bin" "$HOME/.local/bin"];
packages = [
# util
pkgs.fd
pkgs.hexyl
pkgs.pure-prompt
pkgs.ripgrep
pkgs.sd
pkgs.tree
pkgs.watch
pkgs.wget
pkgs.pre-commit
# ui
# pkgs.monaspace
# dev tools
pkgs.bash-language-server
pkgs.cmake-language-server
pkgs.dockerfile-language-server-nodejs
pkgs.nodePackages.vscode-json-languageserver
pkgs.yaml-language-server
pkgs.cachix
pkgs.git-branchless
pkgs.nil
pkgs.jq
# pkgs.yq
pkgs.yq-go
# pkgs.colima
# pkgs.docker-client
# pkgs.docker-buildx
pkgs.gomplate
# markdown
pkgs.marksman
pkgs.pandoc
# k8s
pkgs.argocd
pkgs.awscli2
pkgs.cilium-cli
oci-cli
(pkgs.google-cloud-sdk.withExtraComponents(with pkgs.google-cloud-sdk.components; [
beta
gke-gcloud-auth-plugin
]))
pkgs.packer
pkgs.kubectl
pkgs.kustomize
pkgs.kubernetes-helm
# pkgs.setup-envtest
# pkgs.kubernetes-controller-tools
pkgs.go-task
pkgs.yamllint
pkgs.terraform
pkgs.terraform-ls
pkgs.tflint
pkgs.terraform-docs
pkgs.trivy
pkgs.glab
pkgs.kind
# go
pkgs.golangci-lint
pkgs.gopls
pkgs.gocover-cobertura
# pkgs.gotools
(pkgs.writeShellScriptBin "e" ''
emacsclient -nw "$@"
'')
(pkgs.writeShellScriptBin "ec" ''
emacsclient -n -r "$@"
'')
# (pkgs.writeShellScriptBin "ec" ''
# emacsclient -n -e "(> (length (frame-list)) 1)" | grep -q t
# if [ "$?" = "1" ]; then
# emacsclient -c -n "$@"
# else
# emacsclient -n "$@"
# # emacsclient -n -e "(select-frame-set-input-focus (selected-frame))" > /dev/null
# fi
# '')
# protobuf
# pkgs.protobuf_26
# python
# pkgs.pyright
];
file = {
".config/1Password/ssh/agent.toml".text = ''
[[ssh-keys]]
vault = "Private"
'';
".hushlogin".text = "";
".ignore".text = ".git/";
};
sessionVariables = {
# XDG_DATA_DIRS = "$HOME/.nix-profile/share:$XDG_DATA_DIRS";
# FLAKE_CONFIG_URI = "path:${config.home.homeDirectory}/src/dotfiles";
# SSH_AUTH_SOCK = "$HOME/Library/Group\ Containers/2BUA8C4S2C.com.1password/t/agent.sock";
};
};
fonts.fontconfig.enable = false;
programs = {
atuin = {
enable = true;
settings = {
auto_sync = false;
filter_mode_shell_up_key_binding = "session";
search_mode = "fulltext";
show_preview = true;
style = "compact";
secrets_filter = false;
update_check = false;
};
};
bat = {
enable = true;
config = {
decorations = "never";
pager = "";
theme = "ansi";
};
};
dircolors = {
enable = true;
};
direnv = {
enable = true;
nix-direnv = {
enable = true;
};
};
emacs = {
enable = true;
package = (pkgs.emacsWithPackagesFromUsePackage {
config = ./emacs.el;
defaultInitFile = true;
package = if pkgs.stdenv.isDarwin then pkgs.emacs30 else pkgs.emacs30-pgtk;
alwaysEnsure = true;
extraEmacsPackages = epkgs: [
epkgs.treesit-grammars.with-all-grammars
];
});
};
eza = {
enable = true;
};
git = {
enable = true;
userName = "Diego Pontoriero";
delta = {
enable = true;
options = {
navigate = true;
syntax-theme = "ansi";
minus-style = "reverse red";
minus-emph-style = "reverse bold red";
plus-style = "reverse green";
plus-emph-style = "reverse bold green";
};
};
extraConfig = {
advice = {
addIgnoredFile = false;
};
commit = {
gpgsign = true;
};
fetch = {
prune = true;
tags = true;
};
gpg = {
format = "ssh";
ssh = {
program = if pkgs.stdenv.isDarwin then "/Applications/1Password.app/Contents/MacOS/op-ssh-sign" else "/opt/1Password/op-ssh-sign";
};
};
init = {
defaultBranch = "main";
};
pull = {
rebase = true;
};
push = {
autoSetupRemote = true;
default = "current";
};
url = {
"ssh://[email protected]/" = {
insteadOf = "https://github.com/";
};
};
user = {
signingkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILJasnFrDOljlqzQUCWT34ci8fp5/QgYh2QWvJM2l942";
};
};
aliases = {
mr = "!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -";
};
ignores = [
".direnv/"
".DS_Store"
];
};
go = {
enable = true;
goPath = ".go";
package = pkgs.go;
};
jujutsu = {
enable = false;
settings = {
ui = {
default-command = "log";
};
user = {
name = "Diego Pontoriero";
};
};
};
readline = {
enable = true;
variables = {
show-all-if-ambiguous = true;
page-completions = false;
};
};
skim = {
enable = true;
changeDirWidgetCommand = "fd -H --type d --color=always";
changeDirWidgetOptions = ["--ansi" "--height 100%" "--preview 'tree -C {} | head -200'"];
defaultCommand = "fd -H --type f --color=always";
defaultOptions = ["--ansi" "--height 100%" "--preview 'bat --decorations=always --color=always --style=numbers {}'"];
fileWidgetCommand = "fd -H --type f --color=always";
fileWidgetOptions = ["--ansi" "--height 100%" "--preview 'bat --decorations=always --color=always --style=numbers {}'"];
historyWidgetOptions = [];
};
ssh = let
identityAgent = if pkgs.stdenv.isDarwin then "~/Library/Group\\ Containers/2BUA8C4S2C.com.1password/t/agent.sock" else "~/.1password/agent.sock";
in {
enable = true;
forwardAgent = true;
extraOptionOverrides = {
AddKeysToAgent = "yes";
StrictHostKeyChecking = "no";
} // (if pkgs.stdenv.isDarwin then { UseKeychain = "yes"; } else {});
matchBlocks = {
"192.168.*" = {
extraOptions = {
HostKeyAlgorithms = "+ssh-rsa";
IdentityAgent = identityAgent;
PubkeyAcceptedKeyTypes = "+ssh-rsa";
KexAlgorithms = "+diffie-hellman-group1-sha1";
};
};
"172.17.*" = {
extraOptions = {
HostKeyAlgorithms = "+ssh-rsa";
IdentityAgent = identityAgent;
PubkeyAcceptedKeyTypes = "+ssh-rsa";
KexAlgorithms = "+diffie-hellman-group1-sha1";
};
};
"*.home.arpa" = {
user = "admin";
extraOptions = {
HostKeyAlgorithms = "+ssh-rsa";
IdentityAgent = identityAgent;
PubkeyAcceptedKeyTypes = "+ssh-rsa";
KexAlgorithms = "+diffie-hellman-group1-sha1";
};
};
"github.com" = {
hostname = "ssh.github.com";
port = 443;
extraOptions = {
IdentityAgent = identityAgent;
};
};
"gitlab.com" = {
extraOptions = {
IdentityAgent = identityAgent;
};
};
"gitlab-master.nvidia.com" = {
extraOptions = {
IdentityAgent = identityAgent;
};
};
};
};
zoxide = {
enable = true;
};
zsh = {
enable = true;
defaultKeymap = "emacs";
initExtra = ''
autoload -U promptinit; promptinit
zstyle :prompt:pure:git:stash show yes
prompt pure
autoload -U edit-command-line
zle -N edit-command-line
bindkey "^X^E" edit-command-line
if test -d /opt/homebrew; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
'';
sessionVariables = {
EDITOR = "e";
VISUAL = "e";
};
shellAliases = {
cat = "bat";
k = "kubectl";
tf = "terraform";
};
};
};
xdg = {
enable = true;
};
}