blob: ef863a95f050ae4413368783974f1c560ab1efc9 (
plain)
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
|
{
pkgs,
nurpkgs,
nodeName,
env,
...
}:
let
username = env.username;
homeDirectory = env.homeDirectory;
clipboardCopyCommand = env.gui.clipboard.copyCommand;
requiresWlClipboard = clipboardCopyCommand == "wl-copy";
terminalApp = env.gui.terminalApp;
in
{
nixpkgs.config.allowUnfree = true;
home.username = username;
home.homeDirectory = homeDirectory;
home.stateVersion = "23.11";
programs.home-manager.enable = true;
news.display = "silent";
home.packages =
[
# pkgs.alacritty
pkgs.bat
pkgs.bed
pkgs.curl
pkgs.deno
pkgs.efm-langserver
pkgs.fd
pkgs.fzf
pkgs.git
pkgs.gnumake
pkgs.go
pkgs.gomi
pkgs.htop
pkgs.hyperfine
pkgs.imagemagick
pkgs.jnv
pkgs.jq
pkgs.just
pkgs.mmv-go
pkgs.neovim
pkgs.nodejs_22
pkgs.pandoc
pkgs.phpactor
pkgs.pwgen
pkgs.python314
pkgs.ripgrep
pkgs.ruby_3_4
pkgs.similarity
pkgs.sqlite
pkgs.tokei
pkgs.tree
pkgs.universal-ctags
pkgs.vim
pkgs.nodePackages.pnpm
pkgs.nodePackages.typescript-language-server
pkgs.nodePackages.yarn
nurpkgs.claude-code
nurpkgs.hgrep
nurpkgs.git-helpers
nurpkgs.reparojson
nurpkgs.term-banner
nurpkgs.term-clock
]
++ (
let
php = (
pkgs.php84.buildEnv {
extensions = { enabled, all }: enabled ++ [ all.ffi ];
extraConfig = ''
ffi.enable=true
'';
}
);
in
[
php
php.packages.composer
]
)
++ pkgs.lib.optional requiresWlClipboard pkgs.wl-clipboard;
home.file = {
".config/alacritty/alacritty.common.toml".source = ../../.config/alacritty/alacritty.common.toml;
".config/alacritty/alacritty.local.toml".source = ../../.config/alacritty/alacritty.${env.os}.toml;
".config/alacritty/alacritty.toml".source = ../../.config/alacritty/alacritty.toml;
".config/fish/completions/git-sw.fish".source = ../../.config/fish/completions/git-sw.fish;
".config/git/ignore".source = ../../.config/git/ignore;
".config/nvim".source = ../../.config/nvim;
".config/sh/claude-code.sh".source = ../config/sh/claude-code.sh;
".config/skk/jisyo.L".source = "${pkgs.skkDictionaries.l}/share/skk/SKK-JISYO.L";
".config/vim/vimrc".source = ../../.config/vim/vimrc;
".local/share/fonts/SourceHanCodeJP.ttc".source =
"${nurpkgs.source-han-code-jp}/share/fonts/SourceHanCodeJP.ttc";
".zshrc".source = ../config/zsh/.zshrc;
"bin/__claude-code-notify".source = ../../bin/__claude-code-notify;
"bin/tmux-pane-idx".source = ../../bin/tmux-pane-idx;
".config/git/config".text =
builtins.readFile ../../.config/git/config
+ (
if builtins.pathExists ../../.config/git/local.${nodeName}.config then
builtins.readFile ../../.config/git/local.${nodeName}.config
else
""
);
};
home.sessionVariables = rec {
# XDG Base Directories
# See: https://wiki.archlinux.org/title/XDG_Base_Directory
XDG_CONFIG_HOME = "${homeDirectory}/.config";
XDG_CACHE_HOME = "${homeDirectory}/.cache";
XDG_DATA_HOME = "${homeDirectory}/.local/share";
XDG_STATE_HOME = "${homeDirectory}/.local/state";
# XDG Base Directories: Node.js
NODE_REPL_HISTORY = "${XDG_CACHE_HOME}/node_repl_history";
# XDG Base Directories: PHP
PHP_HISTFILE = "${XDG_CACHE_HOME}/php_history";
# XDG Base Directories: SQLite
SQLITE_HISTORY = "${XDG_CACHE_HOME}/sqlite_history";
# Locale settings
LANG = "en_US.utf-8";
LC_ALL = "";
# Locale: less
LESSCHARSET = "utf-8";
# Editor
VISUAL = "nvim";
EDITOR = "nvim";
# Bat
BAT_THEME = "base16";
# Fzf
FZF_DEFAULT_COMMAND = "fd --type f --strip-cwd-prefix --hidden --exclude .git";
# Hgrep
HGREP_DEFAULT_OPTS = "--theme=Nord";
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
programs.tmux = {
enable = true;
sensibleOnTop = false;
aggressiveResize = true;
baseIndex = 1;
clock24 = true;
escapeTime = 5;
historyLimit = 50000;
mouse = false;
prefix = "C-t";
terminal = "tmux-256color";
extraConfig =
let
commonConfig = builtins.readFile ../config/tmux/tmux.conf;
clipboardConfig =
if clipboardCopyCommand != null then
''
bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "${clipboardCopyCommand}"
''
else
"";
terminalConfig =
if terminalApp == "alacritty" then
''
set-option -ga terminal-overrides ',alacritty:RGB'
''
else
"";
in
commonConfig + clipboardConfig + terminalConfig;
};
programs.bash = {
enable = true;
bashrcExtra = builtins.readFile ../config/bash/.bashrc;
};
programs.fish = {
enable = true;
interactiveShellInit = builtins.readFile ../config/fish/config.fish;
shellInitLast =
builtins.readFile ../config/fish/path.fish
+ (
if builtins.pathExists ../config/fish/local.${nodeName}.path.fish then
builtins.readFile ../config/fish/local.${nodeName}.path.fish
else
""
);
};
programs.starship = {
enable = true;
settings = {
add_newline = true;
command_timeout = 1000;
format = "[$directory$git_branch$git_commit$git_status$git_state](bold fg:75)$fill$cmd_duration$time$line_break$jobs$shell$nix_shell$direnv$character";
continuation_prompt = "[❯](fg:63)[❯](fg:62)[❯](fg:61) ";
character = {
success_symbol = "[❯](fg:150)[❯](fg:153)[❯](fg:159)";
error_symbol = "[❯](fg:172)[❯](fg:173)[❯](fg:174)";
};
directory = {
format = "$path ";
use_os_path_sep = false;
truncate_to_repo = false;
truncation_length = 99;
};
git_branch = {
format = "\\($branch\\)";
};
git_commit = {
format = "\\($hash$tag\\)";
tag_disabled = false;
tag_symbol = " @ ";
};
git_status = {
format = "$conflicted$modified$untracked$staged$stashed";
conflicted = "!";
modified = "~";
untracked = "?";
staged = "*";
stashed = " \\[$count\\]";
};
git_state = {
format = " - $state ($progress_current/$progress_total) ";
};
cmd_duration = {
format = "~$duration ";
};
time = {
disabled = false;
format = "\\[$time\\] ";
time_format = "%T";
};
fill = {
symbol = " ";
};
jobs = {
style = "white";
symbol = "+";
};
shell = {
disabled = false;
format = "[$indicator]($style)";
fish_indicator = "";
bash_indicator = "bash ";
zsh_indicator = "zsh ";
};
nix_shell = {
format = "[N]($style) ";
style = "white";
heuristic = true;
};
direnv = {
disabled = false;
format = "[$loaded]($style)";
style = "white";
loaded_msg = "D ";
unloaded_msg = "";
};
};
};
programs.gh = {
enable = true;
settings.aliases = {
clone = "repo clone";
};
};
}
|