-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
126 lines (120 loc) · 3.75 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
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
# TODO: Change these values to match your username and home directory.
home.username = "inm";
home.homeDirectory = if pkgs.stdenv.isLinux then "/home/inm" else "/Users/inm";
# 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.11"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
xclip
nodejs
du-dust
ripgrep
lsd
bottom
tmux
tree-sitter
lazygit
gdu
rm-improved
just
rustup
ruff
yt-dlp
hyperfine
gh
onefetch
fastfetch
tealdeer
btop
fd
skim
parallel
bacon
uv
serie
nerd-fonts.jetbrains-mono
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
".tmux.conf".source = dotfiles/tmux/tmux.conf;
".config/ghostty/config".source = if pkgs.stdenv.isLinux then dotfiles/ghostty/linux else dotfiles/ghostty/macos;
".config/starship.toml".source = dotfiles/starship/starship.toml;
".config/gitui".source = dotfiles/gitui;
".rye/config.toml".source = dotfiles/rye/config.toml;
};
home.sessionVariables = {
EDITOR = "nvim";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# ZSH
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
initExtra = ''
if [ -f $HOME/.config/home-manager/dotfiles/zsh/.zshrc ];
then
source $HOME/.config/home-manager/dotfiles/zsh/.zshrc
fi
'';
};
# Git
programs.git = {
enable = true;
userName = "Yiming Zhang";
userEmail = "zhangyiming21@mail.ustc.edu.cn";
delta.enable = true;
aliases = {
lg = "lg1";
lg1 = "lg1-specific --all";
lg2 = "lg2-specific --all";
lg3 = "lg3-specific --all";
lg1-specific = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)'";
lg2-specific = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'";
lg3-specific = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset) %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)%n'' %C(white)%s%C(reset)%n'' %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)'";
};
};
# others
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.starship = {
enable = true;
enableZshIntegration = true;
};
programs.yazi = {
enable = true;
enableZshIntegration = true;
};
programs.bat = {
enable = true;
config = {
theme = "gruvbox-dark";
};
};
# programs.atuin = {
# enable = true;
# enableZshIntegration = true;
# settings = {
# auto_sync = true;
# ctrl_n_shortcuts = true;
# enter_accept = false;
# keymap_mode = "vim-normal";
# };
# };
}