-
Notifications
You must be signed in to change notification settings - Fork 1
/
home.nix
266 lines (234 loc) · 7.21 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
{ config, pkgs, lib, ... }:
{
nixpkgs.config = import ./nixpkgs-config.nix;
xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;
nixpkgs.overlays = import ./nixpkgs-overlays.nix;
###
# Set these if _not_ using home-manager as a nixos system module:
# programs.home-manager.enable = true;
# home.username = "benley";
# home.homeDirectory = "/home/benley";
###
# 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 = "20.09";
home.packages = with pkgs; [
# azure-cli
# mu # maildir thing to use with emacs mh maybe?
awscli2
blackbox
cabal-install
cabal2nix
cachix
fd # used by doom emacs (project file search)
ctags
curlie
diffstat # tanka wants this (TODO: fix upstream)
editorconfig-core-c
fd # emacs projectile uses this
gh
go
google-cloud-sdk
google-drive-ocamlfuse
gopls
haskell-language-server
html-tidy
imagemagick # so emacs can resize images
jsonnet
jsonnet-language-server
krew
kube3d
kubectl
kubelogin-oidc
nixfmt-classic
nix-top
nodePackages.bash-language-server
nodePackages.js-yaml
nodePackages.jshint
pyright
pandoc
pdfarranger
rbw
ripgrep
shellcheck
sqlite # org-roam uses this
sshfs
stack
stern
tanka
whois
xournalpp
yq
];
dconf.settings = {
"org/gnome/mutter" = {
"experimental-features" = ["scale-monitor-framebuffer"];
};
};
gtk = {
enable = true;
cursorTheme.name = "Nordic-cursors";
cursorTheme.package = pkgs.nordic;
# cursorTheme.size = 16;
iconTheme.name = "Nordic-green";
iconTheme.package = pkgs.nordic;
theme.name = "Nordic";
theme.package = pkgs.nordic;
# font.name = "Noto Sans Condensed";
# font.size = 10;
# font.package = ...
};
programs.bash = {
enable = true;
enableVteIntegration = true;
historyControl = ["ignoredups" "ignorespace"];
shellOptions = [
"histappend"
"checkwinsize" # update LINES and COLUMNS after each command
"globstar" # extended ** globbing (different from extglob!)
"checkjobs"
"execfail" # don't exit an interactive shell if "exec blah" fails
];
sessionVariables = {
# Fancy timestamps in .bash_history
HISTTIMEFORMAT = "%Y-%m-%d %T ";
# less: extended status prompt, display ANSI colors, case-insensitive search, colorful status bar
LESS = "-M -R -i --use-color";
# nix: don't automatically pipe output to $PAGER, it's too distracting
# NIX_PAGER = "";
};
initExtra = ''
source ${pkgs.gitAndTools.gitFull}/share/git/contrib/completion/git-prompt.sh
for file in ${./bashrc.d}/*; do
source "$file"
done
export PYTHONSTARTUP=${builtins.path {path=./cfg/.pythonrc.py; name="pythonrc.py";}};
# https://felipec.wordpress.com/2021/06/05/adventures-with-man-color/
export MANPAGER="less -M -R -i --use-color -Dd+R -Du+B -DHkC -j5"
export MANROFFOPT="-c" # unclear if this does anything on nixos
'';
};
home.sessionPath = [
"$HOME/.krew/bin"
];
programs.direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
# fonts.fontconfig.enable = true;
programs.emacs = {
enable = true;
extraPackages = epkgs: [
# Preinstall some non-trivial dependencies so emacs doesn't need to build
# them from source
epkgs.use-package
epkgs.vterm
epkgs.emacsql
epkgs.emacsql-sqlite
];
};
services.emacs = {
enable = true;
client.enable = true;
defaultEditor = true;
socketActivation.enable = true;
};
home.file = {
".doom.d" = {
recursive = true;
source = ./cfg/.doom.d;
};
};
programs.git = {
enable = true;
userName = "Benjamin Staffin";
userEmail = "[email protected]";
aliases = {
st = "status";
lg = ''log --graph --pretty=format:'%Cblue%h%Creset %Cgreen%an%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative'';
uplog = "lg ..@{u}";
};
lfs.enable = true;
signing.key = "FDBA38EE781A69D439A870A5A490C0134E09AF4A";
ignores = [
''\#*\#'' # emacs turds
];
extraConfig = {
merge.dpkg-changelogs = {
name = "debian/changelog merge driver";
driver = "dpkg-mergechangelogs -m %O %A %B %A";
};
rerere.enabled = true;
credential.helper = "libsecret";
github.user = "benley";
pull.rebase = true;
gitlab = {
"code.xkrd.net/api/v4".user = "benley";
"gitlab.cloud.memcompute.com/api/v4".user = "bstaffin";
};
push.default = "nothing";
user.useConfigOnly = true;
http.cookieFile = "~/.config/git/cookies";
# http.saveCookies = true;
diff.blackbox.textconv = "gpg --use-agent -q --batch --decrypt";
url."[email protected]:" = {
insteadOf = "https://gitlab.com/";
};
};
includes = [{path = "~/.config/git/secret-stuff.config";}];
};
programs.tmux = {
enable = true;
aggressiveResize = true;
historyLimit = 50000;
keyMode = "vi";
plugins = [
{
plugin = pkgs.tmuxPlugins.power-theme;
extraConfig = ''
set -g @tmux_power_theme 'sky'
set -g @tmux_power_user_icon ''
set -g @tmux_power_time_icon ''
set -g @tmux_power_session_icon ''
'';
}
];
extraConfig = ''
# Enable true-color terminal support
# (I think these are no longer needed since I have patched .terminfo stuff now)
# set-option -ga terminal-overrides ",xterm-256color:Tc" # for Konsole
# set-option -ga terminal-overrides ",xterm-24bit:Tc" # custom stuff
# set-option -ga terminal-overrides ",konsole-direct:Tc"
# Mouse support
set-option -g mouse on
# pane movement
bind-key J command-prompt -p "join pane from:" "join-pane -s ':%%'"
#bind-key s command-prompt -p "send pane to:" "join-pane -t ':%%'"
# Open new windows with the same cwd as the current one
bind-key c new-window -c '#{pane_current_path}'
bind-key '"' split-window -c '#{pane_current_path}'
bind-key % split-window -h -c '#{pane_current_path}'
# don't be anal retentive about releasing ^B before hitting another key
bind-key C-n next-window
bind-key C-p previous-window
bind-key C-c new-window -c '#{pane_current_path}'
set -ga terminal-overrides ',xterm*:XT:Ms=\E]52;%p1%s;%p2%s\007'
set -ga terminal-overrides ',screen*:XT:Ms=\E]52;%p1%s;%p2%s\007'
'';
};
programs.readline = {
enable = true;
# There are some other options here (bindings, variables) but they
# don't seem to be better than just using extraConfig at this
# point, so I'll just include my existing inpurc file
extraConfig = builtins.readFile ./cfg/.inputrc;
includeSystemConfig = true;
};
}