-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.nix
More file actions
328 lines (295 loc) · 9.48 KB
/
home.nix
File metadata and controls
328 lines (295 loc) · 9.48 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
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
{ config, pkgs, lib, ... }:
let
# this will allow the unstable packages to use the same config as on the stable
#unstable = import <nixos-unstable> { config = config.nixpkgs.config; };
autostartPrograms = [ pkgs.slack pkgs.zoom pkgs.vivaldi pkgs.thunderbird ];
in
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = "eric";
home.homeDirectory = "/home/eric";
# 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 should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "23.05"; # Please read the comment before changing.
nixpkgs.config.allowUnfree = true;
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
# # It is sometimes useful to fine-tune packages, for example, by applying
# # overrides. You can do that directly here, just don't forget the
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
vivaldi
vivaldi-ffmpeg-codecs
nixfmt
# unstable.vscode.fhs
# vscode
# (
# vscode-with-extensions.override
# {
# vscodeExtensions = with unstable.vscode-extensions;
# [
# # generatl development related packages
# ms-vscode-remote.remote-ssh
# eamodio.gitlens
# # ms-vscode.powershell
# # ms-azuretools.vscode-docker
# # python related packages
# ms-python.python
# ms-python.vscode-pylance
# # C++ related packages
# ms-vscode.cpptools
# ms-vscode.cmake-tools
# xaver.clang-format
# # nix related packages
# bbenoist.nix
# arrterian.nix-env-selector
# jnoortheen.nix-ide
# ] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace
# [
# {
# publisher = "mjcrouch";
# name = "perforce";
# version = "4.15.7";
# sha256 = "sha256-BXBfxg2GrXvohvu2b02JqtxbGxPxSanNId6DQ39akHI=";
# }
# {
# publisher = "ms-python";
# name = "black-formatter";
# version ="2023.5.12151008";
# sha256 = "sha256-YBcyyE9Z2eL914J8I97WQW8a8A4Ue6C0pCUjWRRPcr8=";
# }
# {
# publisher = "Codeium";
# name = "codeium-enterprise-updater";
# version = "1.0.9";
# sha256 = "sha256-WyDVhc9fjQ+Qgw7F04ESxicRK53vaVxgFtGRHQGpgeI=";
# }
# ];
# }
# )
rclone
obsidian
nextcloud-client
# viber
btop
dua
byobu
tmux
];
services.syncthing = {
enable = true;
tray.enable = false;
};
programs = {
bash.enable = true;
direnv.enable = true;
fish.enable = true;
gitui.enable = true;
# Let Home Manager install and manage itself.
home-manager.enable = true;
# enable ripgrep
ripgrep.enable = true; # rg command
vscode = {
enable = true;
package = pkgs.vscode.fhs;
};
};
programs.ssh = {
enable = true;
matchBlocks = {
"headscale" = {
host = "100.64.0.1";
user = "root";
};
"vscode-server-unraid" = {
hostname = "100.64.0.11";
user = "eric";
};
"office" = {
hostname = "192.168.0.37";
user = "eric";
};
"codeium" = {
hostname = "192.168.0.46";
user = "codeium";
};
"ors-ftp3" = {
hostname = "192.168.0.25";
user = "root";
};
"vm-server2" = {
hostname = "131.153.203.129";
user = "proxmox";
proxyJump = "192.168.0.37";
};
"vm-server2-proxy" = {
hostname = "10.99.99.4";
user = "user";
proxyJump = "vm-server2";
};
"vm-server2-internal-infrastructure" = {
hostname = "10.99.99.5";
user = "user";
proxyJump = "vm-server2";
};
"vm-server2-mattermost" = {
hostname = "10.99.99.6";
user = "user";
proxyJump = "vm-server2";
};
"vm-server2-license-server" = {
hostname = "10.99.99.7";
user = "user";
proxyJump = "vm-server2";
};
"vm-server2-keycloak" = {
hostname = "10.99.99.8";
user = "user";
proxyJump = "vm-server2";
};
};
};
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
coc = { enable = true; };
extraConfig = ''
" set the maplearder to the spacebar
" vim.g.mapleader = "<Space>"
let mapleader = " "
set number relativenumber
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-p> :FZF<CR>
" disbles mouse in neovim in general
set mouse=
" for nerd commentary
filetype plugin on
" This is config for coc to enable tab completion and using enter to select
" Use tab for trigger completion with characters ahead and navigate
" NOTE: There's always complete item selected by default, you may want to enable
" no select by `"suggest.noselect": true` in your configuration file
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
'';
plugins = with pkgs.vimPlugins; [
vim-surround
vim-gitgutter
nerdtree
nerdtree-git-plugin
fzfWrapper
#vim-commentary
vim-airline
nerdcommenter
];
};
# home.file.".config/fish/config.fish".text = ''
## fish configuration added by home-manager
#export MAMBA_ROOT_PREFIX=/home/eric/.config/mamba
#if status is-interactive
# # Commands to run in interactive sessions can go here
#
# export CONDA_EXE=$MAMBA_ROOT_PREFIX/bin/conda
# # This uses the type -q command to check if micromamba is in the PATH. If it is, it will run the eval command to set up the micromamba shell hook for fish. The -s fish part tells it to generate code for the fish shell.
# eval "$(micromamba shell hook -s fish)"
# alias ca "python --version"
#end
#'';
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
} // builtins.listToAttrs (map
(pkg: {
name = ".config/autostart/" + pkg.pname + ".desktop";
value =
if pkg ? desktopItem then {
# Application has a desktopItem entry.
# Assume that it was made with makeDesktopEntry, which exposes a
# text attribute with the contents of the .desktop file
text = pkg.desktopItem.text;
} else {
# Application does *not* have a desktopItem entry. Try to find a
# matching .desktop name in /share/apaplications
source = (pkg + "/share/applications/" + pkg.pname + ".desktop");
};
})
autostartPrograms);
# You can also manage environment variables but you will have to manually
# source
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/eric/etc/profile.d/hm-session-vars.sh
#
# if you don't want to manage your shell through Home Manager.
home.sessionVariables = {
EDITOR = "nvim";
WORLD = "hello";
};
# configure git with my defaults
programs.git = {
enable = true;
userName = "Eric Yen";
userEmail = "eric@ericyen.com";
aliases = { prettylog = "..."; };
delta = {
enable = true;
options = {
navigate = true;
line-numbers = true;
syntax-theme = "GitHub";
};
};
extraConfig = {
core = { editor = "nvim"; };
color = { ui = true; };
push = { default = "simple"; };
pull = { ff = "only"; };
init = { defaultBranch = "main"; };
};
ignores = [
".DS_Store"
"*.pyc"
"..*swp" # swap files
"*.o"
];
};
}