-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
196 lines (174 loc) · 4.23 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
{
pkgs,
nixpkgs,
user,
home,
...
}:
{
targets.genericLinux.enable = pkgs.stdenv.isLinux;
home.username = user;
home.homeDirectory = home;
home.stateVersion = "24.11";
home.packages =
[
# utilities
pkgs.curl
pkgs.dust
pkgs.procs
pkgs.ripgrep
pkgs.sd
pkgs.tlrc
# terminal
pkgs.gitmux
pkgs.tmux-sessionizer
# languages
pkgs.llvmPackages.libcxxClang
pkgs.python312
# lsp
pkgs.clang-tools
pkgs.lua-language-server
pkgs.nixd
pkgs.python312Packages.python-lsp-server
pkgs.taplo
pkgs.typescript-language-server
# build
pkgs.gnumake
pkgs.pkg-config
]
++ (pkgs.lib.optionals pkgs.stdenv.isDarwin [
pkgs.reattach-to-user-namespace
]);
home.file = {
".hushlogin".text = "";
".config/tms/config.toml".text = ''
[[search_dirs]]
path = "~/Software"
depth = 1
'';
};
home.sessionVariables = {
NIX_PATH = "nixpkgs=${nixpkgs}";
GITHUB_TOKEN = "";
};
programs.home-manager.enable = true;
programs.eza.enable = true;
programs.fd.enable = true;
programs.bat.enable = true;
programs.jq.enable = true;
programs.neovim = {
enable = true;
defaultEditor = true;
extraLuaConfig = builtins.readFile ./nvim.lua;
extraPackages = [
pkgs.cargo
pkgs.yarn
];
withNodeJs = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.kitty = {
enable = true;
themeFile = "Catppuccin-Mocha";
shellIntegration = {
enableZshIntegration = true;
};
keybindings = {
"cmd+t" = "discard_event";
};
settings = {
font_size = "16.0";
macos_option_as_alt = "yes";
tab_bar_style = "hidden";
};
};
programs.fzf = {
enable = true;
defaultCommand = "fd --type f";
defaultOptions = [
"--preview"
"'bat --color=always --style=numbers --line-range=:250 {}'"
];
};
programs.zsh = {
enable = true;
shellAliases = {
vimf = ''nvim -o "$(fzf)"'';
fda = "fd --hidden --exclude .git --exclude .direnv --exclude __pycache__ --type f";
du = "du -A";
};
defaultKeymap = "emacs";
initExtra = ''
PROMPT='%F{blue}%~%f $ '
function git-open() { (
set -e
git remote >>/dev/null
remote=''${1:-origin}
url=$(git config remote.$remote.url | sed "s/git@\(.*\):\(.*\).git/https:\/\/\1\/\2/")
echo "git: opening $remote $url"
open $url
); }
if [ -z "$TMUX" ] && [ "$TERM" = "xterm-kitty" ]; then
tmux new-session -A -c $HOME -s home;
fi
'';
};
programs.git = {
enable = true;
userEmail = "josheppinette@gmail.com";
userName = "Joshua Taylor Eppinette";
aliases = {
conflicts = "diff --name-only --diff-filter=U --relative";
};
extraConfig = {
merge = {
conflictstyle = "zdiff3";
};
init = {
defaultBranch = "main";
};
};
};
programs.tmux = {
enable = true;
keyMode = "vi";
terminal = "screen-256color";
shell = "${pkgs.zsh}/bin/zsh";
plugins = with pkgs; [
tmuxPlugins.yank
tmuxPlugins.sensible
tmuxPlugins.open
tmuxPlugins.resurrect
tmuxPlugins.continuum
{
plugin = tmuxPlugins.catppuccin;
extraConfig = ''
set -g @catppuccin_status_modules_left "session application"
set -g @catppuccin_status_modules_right "gitmux user host date_time"
set -g @catppuccin_status_left_separator "█"
set -g @catppuccin_status_right_separator "█"
set -g @catppuccin_date_time_text "%Y-%m-%d %I:%M %p"
'';
}
];
extraConfig = ''
set -gu default-command
set -g window-status-current-format ""
set -g window-status-format ""
bind s display-popup -E "tms switch"
bind o display-popup -E "tms"
bind q run-shell "tms kill"
bind n command-prompt -p "init repo:" "run-shell 'tms init-repo %1'"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
'';
};
}