-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
245 lines (216 loc) · 5.98 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
245
{ config, pkgs, lib, ... }:
{
# 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 can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "23.05";
# For MacOS only!
home.username = "Auguste";
home.homeDirectory = /Users/Auguste;
home.packages = with pkgs; [
agedu
cargo
dura # Git tool for commiting unstaged code
fd
jq
micromamba
nixfmt
ripgrep
tealdeer # Rewrite of tldr
tree
# tectonic
elan # Lean package manager
];
programs = {
bat = { enable = true; };
broot = { enable = true; };
direnv = {
enable = true;
nix-direnv.enable = true;
stdlib = builtins.readFile ./config/direnv/direnvrc;
};
exa = { enable = true; };
fzf = {
enable = true;
defaultOptions = [ "--extended" "--cycle" ];
};
git = import ./config/git/config.nix;
helix = {
enable = true;
settings = import ./config/helix/config.nix;
# languages = (builtins.fromTOML (builtins.readFile ./config/helix/languages.toml));
};
# Let Home Manager install and manage itself.
home-manager = { enable = true; };
neovim = { enable = true; };
nnn = {
enable = true;
bookmarks = {
d = "~/Desktop";
c = "~/.config";
n = "~/Documents/Nextcloud/Notes";
};
plugins = {
src = ./config/nnn/plugins;
mappings = {
z = "jump";
g = "rec";
h = "fzopen";
o = "open";
};
};
};
starship = {
enable = true;
settings =
(builtins.fromTOML (builtins.readFile ./config/starship/config.toml));
};
wezterm = {
enable = true;
extraConfig = builtins.readFile ./config/wezterm/wezterm.lua;
};
zathura = import ./config/zathura/config.nix;
zoxide = { enable = true; };
zsh = {
enable = true;
completionInit = ''
autoload -U compinit
zstyle ':completion:*' menu select
zmodload zsh/complist
compinit -C
_comp_options+=(globdots) # Include hidden files in autocomplete:
'';
# Adding this to login so that it's run after zshrc, where the zoxide
# init script is run
loginExtra = ''
# Use `zf` with `zoxide`
if command -v zf &> /dev/null
then
function __zoxide_zi() {
result="$(zoxide query -l -- "$@" | zf)" && cd "$result"
}
fi
'';
initExtra = builtins.readFile ./config/zsh/zshrc;
dotDir = ".config/zsh";
};
};
home.sessionVariables = rec {
CONFIG = "${config.home.homeDirectory}/.config";
XDG_CONFIG = "${CONFIG}";
SHARE = "${config.home.homeDirectory}/.local/share";
EDITOR = "hx";
GIT_EDITOR = "$EDITOR";
VISUAL = "$EDITOR";
LESS = "-imJMWR";
PAGER = "less ${LESS}";
MANPAGER = "$PAGER";
GIT_PAGER = "$PAGER";
BROWSER = "qutebrowser";
TERMINAL = "wezterm";
LANG = "en_US.UTF-8";
LC_ALL = "${LANG}";
LC_COLLATE = "C";
LSCOLORS = "gxfxcxdxbxegedabagacad";
NEXTCLOUD_DIR = "${config.home.homeDirectory}/Documents/Nextcloud";
NOTES_DIR = "${NEXTCLOUD_DIR}/Notes";
DIARY_DIR = "${NOTES_DIR}/diary";
TODO_FILE = "${NOTES_DIR}/todo.md";
## cargo
CARGO_HOME = "${CONFIG}/cargo";
## doom-emacs
DOOMDIR = "${CONFIG}/doom";
## flavours
FLAVOURS_CONFIG_FILE = "${CONFIG}/flavours/config.toml";
FLAVOURS_DATA_DIRECTORY = "${SHARE}/flavours";
## goku
GOKU_EDN_CONFIG_FILE = "${CONFIG}/karabiner/karabiner.edn";
## grep
GREP_OPTIONS = "--color=auto";
## IPython
IPYTHONDIR = "${CONFIG}/ipython";
## nix
NIX_PAGER = "cat";
## nnn
NNN_OPTS = "He";
# Use trash-cli instead of rm
NNN_TRASH = "1";
NNN_CONTEXT_COLORS = "4312";
# Custom 'open' script
NNN_OPENER = "${CONFIG}/nnn/plugins/nuke";
## nvim
NVIM_CONFIG_DIR = "${CONFIG}/nvim";
## pass
PASSWORD_STORE_DIR = "${SHARE}/pass/.password-store";
PASSWORD_STORE_ENABLE_EXTENSIONS = "true";
PASSWORD_STORE_EXTENSIONS_DIR = "${PASSWORD_STORE_DIR}/.extensions";
## poetry
POETRY_VIRTUALENVS_IN_PROJECT = "1";
## qmk
QMK_HOME = "${CONFIG}/qmk/qmk_firmware";
};
home.sessionPath = [
(toString ./config/scripts)
# Ideally I would add Rust programs to this config
# rather than getting them here
"${config.home.sessionVariables.CARGO_HOME}/bin"
];
home.shellAliases = with config.home.sessionVariables; {
"..." = "../..";
cf = "$EDITOR ${CONFIG}";
cl = "clear";
cm = "chezmoi";
e = "$EDITOR";
"e." = "$EDITOR .";
emacs = "emacs -nw";
gn = "nvim -c Neogit";
hms =
"home-manager switch --flake 'path:${CONFIG}/nixpkgs#${config.home.username}'";
ipt = "ipython";
k = "kak";
l = "exa --all --long";
ls = "ls -AFHG";
m = "micromamba";
ma = "micromamba activate";
md = "micromamba deactivate";
mi = "micromamba install";
ne = "nix-env";
nd = "mkdir";
nf = "touch";
p = "pijul";
p3 = "python3";
po = "poetry";
pt = "pytest";
t = "tldr";
tec = "tectonic";
tw = "taskwarrior-tui";
v = "nvim";
vi = "nvim";
# Scripts
n = "source ${toString ./config/scripts}/n";
# Git
ga = "git add";
gaa = "git add --all";
gc = "git commit --verbose";
gca = "git commit --verbose --all";
gcam = "git commit --verbose --amend";
gd = "git diff";
gl = "git log --oneline -n 10";
grh = "git reset --hard";
grl = "git reflog";
grm = "git rm";
gs = "git status --short";
gch = "git checkout";
gb = "git branch";
gbd = "git branch --delete";
gbl = "git branch --list";
gp = "git pull";
gpp = "git push";
gpf = "git push --force";
};
}