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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
|
{ config, lib, pkgs, inputs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
imports = [
./packages.nix
./unstable.nix
./home-minimal.nix
];
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = 1;
_JAVA_AWT_WM_NONREPARENTING = 1;
};
xdg.mimeApps = {
enable = true;
associations.added."application/pdf" = [ "org.pwmt.zathura.desktop" ];
defaultApplications."application/pdf" = [ "org.pwmt.zathura.desktop" ];
};
programs.msmtp.enable = true;
programs.mbsync.enable = true;
programs.mu.enable = true;
accounts.email = {
accounts.hacc = {
address = "stuebinm@hacc.space";
imap.host = "mail.hacc.space";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
primary = true;
realName = "stuebinm";
smtp.host = "mail.hacc.space";
userName = "stuebinm@hacc.space";
passwordCommand = "secret-tool lookup mail hacc";
};
accounts.disroot = {
address = "stuebinm@disroot.org";
imap.host = "disroot.org";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
realName = "terru";
smtp.host = "disroot.org";
userName = "stuebinm@disroot.org";
passwordCommand = "secret-tool lookup mail disroot";
};
accounts.tum = {
address = "stuebinm@in.tum.de";
imap.host = "mail.in.tum.de";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
realName = "stuebinm";
smtp.host = "mail.in.tum.de";
userName = "stuebinm@in.tum.de";
passwordCommand = "secret-tool lookup mail in.tum.de";
};
accounts.ilztalbahn = {
address = "stuebinm@ilztalbahn.eu";
imap.host = "imap.strato.de";
mbsync = {
enable = true;
create = "maildir";
};
msmtp.enable = true;
mu.enable = true;
realName = "terru";
smtp.host = "smtp.strato.de";
userName = "stuebinm@ilztalbahn.eu";
passwordCommand = "secret-tool lookup mail ilztalbahn";
};
};
programs.bash = {
shellAliases = {
"lrz-vpn" = "sudo openconnect https://asa-cluster.lrz.de -g AnyConnect";
news = "newsboat";
pj = "pijul";
};
};
programs.fish = {
shellAliases = {
"lrz-vpn" = "sudo openconnect https://asa-cluster.lrz.de";
news = "newsboat";
pj = "pijul";
agenda = "CLICOLOR_FORCE=1 almanac month ~/.cache/feedsync/* | less";
xmlpretty = "xmllint --format - | bat -l xml";
wormhole = "wormhole-rs";
noms = "curl https://www.bahn.de/service/zug/db_lounge -s | htmlq --attribute href a | grep Speisen | xargs curl -s | pdftotext - /dev/stdout | less";
};
functions.fetchpdf.body = ''
set url $argv[1]
if test "$url" = ""
echo "No url given"
return
end
set anchors (curl -L $url | sd '\n' "" | htmlq a | rg .pdf)
set choice (paste (printf '%s\n' $anchors | htmlq -t a | psub) (printf '%s\n' $anchors | htmlq --attribute href a | psub) | fzf)
if test "$status" != 0
return
end
set docurl (echo $choice | cut -f 2)
set docname (echo $choice | cut -f 1)
echo Fetching $docname from $docurl
curl "$docurl" > ~/Downloads/news/"$docname".pdf
zathura ~/Downloads/news/"$docname".pdf
if test (read -P "move this file to archive? [y/N] ") = "y"
set filename (read -P "filename? [$docname] ")
if test "$filename" = ""
cp ~/Downloads/news/"$docname".pdf ~/archive/"$docname".pdf
else
cp ~/Downloads/news/"$docname".pdf ~/archive/$filename
end
end
'';
functions.nix-what.body = ''
nix-doc search $argv[1] ~/clones/nixpkgs
'';
functions.bahnsteig.body = ''
set station (echo $argv)
if string upper -q $station
set name (string escape --style=url $station)
set station (curl -sL https://ril100.bahnhof.name/$name)
echo ril100 $station
end
curl -s https://overpass-api.de/api/interpreter -d "
[out:json][timeout:25];
node[~\"railway:ref|railway:ref:parent\"~\"^$station\$\"][operator~\"^(DB|Deutsch)\"];
rel[public_transport~\"stop_area|stop_area_group\"](bn) -> .a;
rel[public_transport~\"stop_area|stop_area_group\"](br.a) -> .b;
(.a;.b;);
nwr[railway=platform](>>);
out;
" | jq '.elements[].tags.ref | select(. != null)' | sort
'';
functions.stealemoji.body = ''
if [ (expr (count $argv) % 2) != 0 ]
echo wrong count of arguments
exit 1
end
set n (expr (count $argv) / 2)
echo stealing $n emoji
mkdir -p /tmp/stealemoji
for i in (seq $n)
echo stealing $i
curl -s $argv[$i] > /tmp/$argv[(expr $i + 1)].png
end
cd /tmp
scp $argv[(seq 2 2 (expr $n + 1))].png flora:/var/lib/containers/pleroma/var/lib/akkoma/static/emoji/unsorted/
ssh flora machinectl shell pleroma /bin/sh -c \"pleroma_ctl emoji reload\"
'';
};
programs.kitty = {
enable = true;
extraConfig = ''
background_opacity 0.8
confirm_os_window_close 0
allow_remote_control yes
'';
};
programs.neovim = {
enable = true;
viAlias = true;
plugins = with pkgs; [
(vimPlugins.nvim-treesitter.withPlugins
(plugins: [ tree-sitter-grammars.tree-sitter-nix ]))
];
generatedConfigViml = ''
lua <<EOF
require'nvim-treesitter.configs'.setup {
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
ensure_installed = "all",
-- Install languages synchronously (only applied to `ensure_installed`)
sync_install = false,
-- List of parsers to ignore installing
ignore_install = { "javascript" },
highlight = {
-- `false` will disable the whole extension
enable = true,
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
EOF
'';
};
systemd.user.services.syncical = let
feeds = (import inputs.feeds).ical; in {
Unit.Description = "syncs ical feeds for almanac agenda";
Service = {
ExecStart = (pkgs.writeShellScript "syncical" ''
${pkgs.gauche}/bin/gosh ${./scripts/sync.scm} ${lib.escapeShellArgs feeds}
'').outPath;
X-ReloadIfChanged = true;
Environment = ''
PATH=${pkgs.curl}/bin:${pkgs.coreutils}/bin
'';
};
};
systemd.user.timers.syncical = {
Unit.Description = "automatically fetch new calendars";
Timer = {
OnCalendar = "hourly";
Unit = "syncical.service";
};
Install.WantedBy = [ "timers.target" ];
};
programs.newsboat = {
enable = true;
urls = (import ./newsboat-public.nix) ++ (import inputs.feeds).rss;
browser = lib.getExe' pkgs.offpunk "offpunk";
reloadThreads = 200;
queries = {
unread = ''unread="yes"'';
non-papers = ''( unread="yes" ) and ( tags !# "paper" )'';
non-video = ''( unread="yes" ) and ( tags !# "paper" ) and ( tags !# "video" )'';
paper = ''tags # "paper"'';
};
extraConfig = ''
color background white default
color listnormal white default
color listnormal_unread magenta default bold
color listfocus black white bold
color listfocus_unread magenta white bold
color info green color0
color article white default
ssl-verifypeer no
macro v set browser "kitty @launch --type tab mpv --ytdl-format='b[height<=1100]' %u > /dev/null" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u"
macro f set browser "${pkgs.xdg_utils}/bin/xdg-open %u >/dev/null 2>&1 &" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u"
macro d set browser "kitty @launch --type tab fish -c 'fetchpdf %u'" ; open-in-browser ; set browser "${config.programs.newsboat.browser} %u"
bind-key j down
bind-key k up
'';
};
programs.gpg = {
enable = true;
settings = {
auto-key-locate = "keyserver";
with-fingerprint = "";
};
};
programs.ssh = {
# forwardAgent = true;
enable = true;
matchBlocks = let
keydir = config.home.homeDirectory + "/.ssh";
hetznerlogin = match: {user = "root"; identityFile = keydir + "/hetzner.pub";} // match;
vpslogin = hostname: hetznerlogin {inherit hostname;};
in {
"parsons" = {
hostname = "parsons.hacc.space";
port = 62954;
user = "stuebinm";
identityFile = keydir + "/id_ed25519";
};
"flora" = vpslogin "flora.stuebinm.eu";
"chaski" = vpslogin "chaski.stuebinm.eu";
"cgit" = vpslogin "flora.stuebinm.eu" // {user = "git";};
"mate" = {
hostname = "192.168.69.174";
user = "root";
identityFile = keydir + "/hetzner.pub";
};
"c3voc" = {
hostname = "git.c3voc.de";
user = "git";
identityFile = keydir + "/id_ed25519";
};
"nobelium" = {
hostname = "no.colorspace.club";
user = "root";
identityFile = keydir + "/id_ed25519";
};
"colorspace-git" = {
hostname = "no.colorspace.club";
user = "git";
identityFile = keydir + "/id_ed25519";
};
"git.infra4future.de" = {
hostname = "git.infra4future.de";
user = "gitea";
identityFile = keydir + "/id_ed25519";
addressFamily = "inet";
};
"namauh" = {
hostname = "10.11.99.1";
user = "root";
identityFile = keydir + "/id_ed25519";
};
};
};
programs.mpv = {
enable = true;
bindings = {
"up" = "add speed 0.1";
"down" = "add speed -0.1";
"n" = "add chapter 1";
"p" = "add chapter -1";
"f" = "cycle osd-level up";
};
config.osd-status-msg = "\${estimated-frame-number} (\${percent-pos}%)";
};
services.mako = {
enable = true;
backgroundColor = "#74389eb0";
borderColor = "#c27cb6ff";
defaultTimeout = 5000; # milliseconds
padding = "10";
output = "DP-9";
};
services.mpd = {
enable = true;
musicDirectory = "${config.home.homeDirectory}/music";
network.startWhenNeeded = true;
};
programs.bat = {
enable = true;
config.wrap = "never";
syntaxes = {
isabelle = {
src = inputs.isabelle-utils;
file = "/isabelle.sublime-syntax";
};
gleam = {
src = pkgs.fetchFromGitHub {
owner = "molnarmark";
repo = "sublime-gleam";
rev = "2e761cdb1a87539d827987f997a20a35efd68aa9";
sha256 = "sha256-Zj2DKTcO1t9g18qsNKtpHKElbRSc9nBRE2QBzRn9+qs=";
};
file = "/syntax/gleam.sublime-syntax";
};
};
};
xdg.mimeApps.associations.added."x-scheme-handler/tg" = "org.telegram.desktop.deskopt";
}
|