-
Notifications
You must be signed in to change notification settings - Fork 5
/
home.nix
244 lines (226 loc) · 4.81 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
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
{
config,
lib,
pkgs,
colorscheme,
fonts,
userName,
...
}:
let
inherit (pkgs.stdenv) isDarwin isLinux;
configDir = ./configs;
configs = import "${configDir}" {
inherit (pkgs) lib;
inherit colorscheme config pkgs;
palette = import (./palettes + "/${colorscheme}.nix");
};
in
{
inherit fonts;
home = {
homeDirectory =
if isDarwin then
"/Users/${userName}"
else if isLinux then
"/home/${userName}"
else
throw "What's the home directory for this OS?";
packages =
with pkgs;
[
asciinema
delta
dua
gh
helix
jq
neovim
nixVersions.latest
nodejs # Needed by Copilot.
ookla-speedtest
pfetch
python312Packages.ipython
ripgrep
scripts.fuzzy-ripgrep
scripts.lf-recursive
scripts.preview
scripts.rg-pattern
scripts.rg-preview
spotify
texliveConTeXt
tokei
tree
unzip
vimv
zip
zoom-us
]
++ lib.lists.optionals isDarwin [
brewCasks.protonvpn
coreutils
gnused
]
++ lib.lists.optionals isLinux [
cameractrls
clang # Needed by Neovim to compile Tree-sitter grammars.
feh
glxinfo
grimblast
libnotify
obs-studio
pciutils # Contains lspci.
pick-colour-picker
playerctl
proton-pass
protonvpn-cli_2
signal-desktop
wl-clipboard-rs
xdg-utils
]
# Lua.
++ [
stylua
sumneko-lua-language-server
]
# Markdown.
++ [ marksman ]
# Nix.
++ [
nil
nixfmt-rfc-style
]
# Rust.
++ (
let
components = [
"clippy"
# Needed by `cargo-llvm-cov`.
"llvm-tools"
"rust-analyzer"
# Needed by `rust-analyzer` to index `std`.
"rust-src"
"rustfmt"
];
in
[
(rust-bin.selectLatestNightlyWith (
toolchain: toolchain.minimal.override { extensions = components; }
))
cargo-criterion
cargo-deny
cargo-expand
cargo-flamegraph
cargo-fuzz
]
# cargo-llvm-cov is currently broken on macOS.
# ++ lib.lists.optionals (!isDarwin) [ cargo-llvm-cov ]
)
# Typescript.
++ [
prettierd
typescript
typescript-language-server
];
pointerCursor = lib.mkIf isLinux {
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
size = 16;
};
sessionVariables = {
CARGO_HOME = "${config.xdg.dataHome}/cargo";
EDITOR = "nvim";
MANPAGER = "nvim +Man! -";
LANG = "en_US.UTF-8";
LC_ALL = "en_US.UTF-8";
COLORTERM = "truecolor";
LS_COLORS = "$(vivid generate current)";
LF_ICONS = (builtins.readFile "${configDir}/lf/LF_ICONS");
HISTFILE = "${config.xdg.cacheHome}/bash/bash_history";
LESSHISTFILE = "${config.xdg.cacheHome}/less/lesshst";
OSFONTDIR = lib.strings.optionalString isLinux (
config.home.homeDirectory + "/.nix-profile/share/fonts/truetype/NerdFonts"
);
};
stateVersion = "22.11";
username = userName;
};
imports = [
./modules/home/all.nix
];
nix = {
package = pkgs.nixVersions.latest;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
trusted-substituters = [
"https://cache.soopy.moe"
"https://nix-community.cachix.org"
];
warn-dirty = false;
};
};
programs = {
inherit (configs)
alacritty
bat
direnv
fd
fish
fuzzel
fzf
git
gpg
home-manager
lazygit
lf
mpv
nix-index
qutebrowser
ripgrep
starship
vivid
zathura
;
};
services = {
bluetooth-autoconnect = {
enable = isLinux;
};
inherit (configs)
fusuma
gpg-agent
kanshi
mpris-proxy
ssh-agent
udiskie
wlsunset
;
};
systemd.user.startServices = true;
wayland.windowManager.hyprland = configs.hyprland;
xdg = {
configFile = {
"nvim" = {
source = "${configDir}/neovim";
recursive = true;
};
};
dataFile = {
"cargo/config.toml" = {
text = configs.cargo.configDotToml;
};
};
mimeApps = {
enable = isLinux;
defaultApplications = {
"application/pdf" = [ "org.pwmt.zathura.desktop" ];
"text/html" = [ "qutebrowser.desktop" ];
"x-scheme-handler/http" = [ "qutebrowser.desktop" ];
"x-scheme-handler/https" = [ "qutebrowser.desktop" ];
};
};
};
}