-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
201 lines (188 loc) · 4.84 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
{
config,
pkgs,
lib,
...
}:
let
cfg = config.home.sweet;
in
{
options.home.sweet = with lib; {
enable = mkOption {
type = types.bool;
default = false;
};
fonts = {
normal = mkOption {
type = types.bool;
default = false;
};
nerd = mkOption {
type = types.bool;
default = false;
};
};
icons = mkOption {
type = types.bool;
default = cfg.fonts.nerd;
};
level = mkOption {
type = types.enum [
"minimal"
"normal"
"extra"
];
default = "normal";
};
options.programs.wezterm = {
enable = mkOption {
type = types.bool;
default = false;
};
};
};
imports = [
./zsh.nix
./git.nix
./aliases.nix
./neovim
];
config = lib.mkIf cfg.enable {
# 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 = lib.mkDefault "23.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages =
with pkgs;
let
basic = [
ripgrep
fd
htop
];
common = lib.optionals (cfg.level != "minimal") [
nil
nixfmt-rfc-style
nixpkgs-fmt
];
extra = lib.optionals (cfg.level == "extra") [
hut
shellcheck
btop
du-dust
tealdeer
];
nerd-fonts = lib.optionals cfg.fonts.nerd [
(nerdfonts.override {
# https://github.com/ryanoasis/nerd-fonts#patched-fonts
fonts = [
"FantasqueSansMono"
"FiraCode"
"DroidSansMono"
"IBMPlexMono"
"Iosevka"
"IosevkaTerm"
"IntelOneMono"
"JetBrainsMono"
"VictorMono"
"CascadiaCode"
"Go-Mono"
"SpaceMono"
"Hack"
"Overpass"
"Lilex"
];
})
];
fonts = lib.optionals cfg.fonts.normal [
sarasa-gothic
iosevka
ibm-plex
monaspace
cascadia-code
noto-fonts
];
in
basic
++ common
++ extra
++ nerd-fonts
++ fonts
++ (lib.optional config.programs.wezterm.enable wezterm);
programs.eza = {
enable = lib.mkDefault cfg.level != "minimal";
icons = cfg.icons;
enableFishIntegration = true;
enableZshIntegration = true;
extraOptions = [ "--group-directories-first" ];
};
programs.tmux = {
enable = lib.mkDefault true;
clock24 = true;
prefix = "`";
mouse = true;
plugins =
with pkgs.tmuxPlugins;
let
theme = lib.optionals (cfg.level != "minimal") [
{
plugin = dracula;
# https://draculatheme.com/tmux
extraConfig = ''
set -g @dracula-show-battery false
set -g @dracula-show-powerline false
set -g @dracula-refresh-rate 5
set -g @dracula-show-left-icon session
set -g @dracula-plugins "ssh-session cpu-usage ram-usage"
'';
}
];
in
theme;
};
programs.fish = {
interactiveShellInit = ''
set fish_greeting # Disable greeting
'';
plugins = [ ];
shellInit = builtins.readFile ./init.fish;
};
programs.zoxide.enable = true;
# fzf https://github.com/junegunn/fzf#fzf-tmux-script
programs.fzf = {
enable = lib.mkDefault cfg.level != "minimal";
defaultCommand = "fd --type f";
tmux.enableShellIntegration = true;
};
programs.alacritty = lib.mkIf config.programs.alacritty.enable {
# https://github.com/alacritty/alacritty/blob/master/alacritty.yml
settings = {
window = {
padding = {
x = 6;
};
};
font.size = 14.0;
font.normal.family = "BlexMono Nerd Font Mono";
};
};
programs.helix = lib.mkIf config.programs.helix.enable {
settings = {
theme = "spacebones_light";
};
};
xdg.configFile."wezterm/wezterm.lua".source = ./wezterm.lua;
xdg.configFile."wezterm/shell.lua".text = ''
return { "${lib.getExe config.programs.fish.package}", "-l" }
'';
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
};
}