-
Notifications
You must be signed in to change notification settings - Fork 80
/
home.nix
249 lines (229 loc) · 6.35 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
{
# FIXME: uncomment the next line if you want to reference your GitHub/GitLab access tokens and other secrets
# secrets,
pkgs,
username,
nix-index-database,
...
}: let
unstable-packages = with pkgs.unstable; [
# FIXME: select your core binaries that you always want on the bleeding-edge
bat
bottom
coreutils
curl
du-dust
fd
findutils
fx
git
git-crypt
htop
jq
killall
mosh
procs
ripgrep
sd
tmux
tree
unzip
vim
wget
zip
];
stable-packages = with pkgs; [
# FIXME: customize these stable packages to your liking for the languages that you use
# FIXME: you can add plugins, change keymaps etc using (jeezyvim.nixvimExtend {})
# https://github.com/LGUG2Z/JeezyVim#extending
jeezyvim
# key tools
gh # for bootstrapping
just
# core languages
rustup
# rust stuff
cargo-cache
cargo-expand
# local dev stuf
mkcert
httpie
# treesitter
tree-sitter
# language servers
nodePackages.vscode-langservers-extracted # html, css, json, eslint
nodePackages.yaml-language-server
nil # nix
# formatters and linters
alejandra # nix
deadnix # nix
nodePackages.prettier
shellcheck
shfmt
statix # nix
];
in {
imports = [
nix-index-database.hmModules.nix-index
];
home.stateVersion = "22.11";
home = {
username = "${username}";
homeDirectory = "/home/${username}";
sessionVariables.EDITOR = "nvim";
# FIXME: set your preferred $SHELL
sessionVariables.SHELL = "/etc/profiles/per-user/${username}/bin/fish";
};
home.packages =
stable-packages
++ unstable-packages
++
# FIXME: you can add anything else that doesn't fit into the above two lists in here
[
# pkgs.some-package
# pkgs.unstable.some-other-package
];
programs = {
home-manager.enable = true;
nix-index.enable = true;
nix-index.enableFishIntegration = true;
nix-index-database.comma.enable = true;
# FIXME: disable this if you don't want to use the starship prompt
starship.enable = true;
starship.settings = {
aws.disabled = true;
gcloud.disabled = true;
kubernetes.disabled = false;
git_branch.style = "242";
directory.style = "blue";
directory.truncate_to_repo = false;
directory.truncation_length = 8;
python.disabled = true;
ruby.disabled = true;
hostname.ssh_only = false;
hostname.style = "bold green";
};
# FIXME: disable whatever you don't want
fzf.enable = true;
fzf.enableFishIntegration = true;
lsd.enable = true;
lsd.enableAliases = true;
zoxide.enable = true;
zoxide.enableFishIntegration = true;
zoxide.options = ["--cmd cd"];
broot.enable = true;
broot.enableFishIntegration = true;
direnv.enable = true;
direnv.nix-direnv.enable = true;
git = {
enable = true;
package = pkgs.unstable.git;
delta.enable = true;
delta.options = {
line-numbers = true;
side-by-side = true;
navigate = true;
};
userEmail = ""; # FIXME: set your git email
userName = ""; #FIXME: set your git username
extraConfig = {
# FIXME: uncomment the next lines if you want to be able to clone private https repos
# url = {
# "https://oauth2:${secrets.github_token}@github.com" = {
# insteadOf = "https://github.com";
# };
# "https://oauth2:${secrets.gitlab_token}@gitlab.com" = {
# insteadOf = "https://gitlab.com";
# };
# };
push = {
default = "current";
autoSetupRemote = true;
};
merge = {
conflictstyle = "diff3";
};
diff = {
colorMoved = "default";
};
};
};
# FIXME: This is my fish config - you can fiddle with it if you want
fish = {
enable = true;
# FIXME: run 'scoop install win32yank' on Windows, then add this line with your Windows username to the bottom of interactiveShellInit
# fish_add_path --append /mnt/c/Users/<Your Windows Username>/scoop/apps/win32yank/0.1.1
interactiveShellInit = ''
${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source
${pkgs.lib.strings.fileContents (pkgs.fetchFromGitHub {
owner = "rebelot";
repo = "kanagawa.nvim";
rev = "de7fb5f5de25ab45ec6039e33c80aeecc891dd92";
sha256 = "sha256-f/CUR0vhMJ1sZgztmVTPvmsAgp0kjFov843Mabdzvqo=";
}
+ "/extras/kanagawa.fish")}
set -U fish_greeting
'';
functions = {
refresh = "source $HOME/.config/fish/config.fish";
take = ''mkdir -p -- "$1" && cd -- "$1"'';
ttake = "cd $(mktemp -d)";
show_path = "echo $PATH | tr ' ' '\n'";
posix-source = ''
for i in (cat $argv)
set arr (echo $i |tr = \n)
set -gx $arr[1] $arr[2]
end
'';
};
shellAbbrs =
{
gc = "nix-collect-garbage --delete-old";
}
# navigation shortcuts
// {
".." = "cd ..";
"..." = "cd ../../";
"...." = "cd ../../../";
"....." = "cd ../../../../";
}
# git shortcuts
// {
gapa = "git add --patch";
grpa = "git reset --patch";
gst = "git status";
gdh = "git diff HEAD";
gp = "git push";
gph = "git push -u origin HEAD";
gco = "git checkout";
gcob = "git checkout -b";
gcm = "git checkout master";
gcd = "git checkout develop";
gsp = "git stash push -m";
gsa = "git stash apply stash^{/";
gsl = "git stash list";
};
shellAliases = {
jvim = "nvim";
lvim = "nvim";
pbcopy = "/mnt/c/Windows/System32/clip.exe";
pbpaste = "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -command 'Get-Clipboard'";
explorer = "/mnt/c/Windows/explorer.exe";
};
plugins = [
{
inherit (pkgs.fishPlugins.autopair) src;
name = "autopair";
}
{
inherit (pkgs.fishPlugins.done) src;
name = "done";
}
{
inherit (pkgs.fishPlugins.sponge) src;
name = "sponge";
}
];
};
};
}