-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.html
3714 lines (3357 loc) · 349 KB
/
README.html
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<!-- 2024-12-03 Út 16:47 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>My System Config</title>
<meta name="author" content="(λ () nil)" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/htmlize.css"/>
<link rel="stylesheet" type="text/css" href="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/css/readtheorg.css"/>
<link rel="stylesheet" type="text/css" href="src/readtheorg_theme/css/search.css"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/lib/js/jquery.stickytableheaders.min.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/search.js"></script>
<script type="text/javascript" src="https://fniessen.github.io/org-html-themes/src/readtheorg_theme/js/readtheorg.js"></script>
<script type="text/javascript">disableSearch();</script>
</head>
<body>
<div id="content" class="content">
<h1 class="title">My System Config</h1>
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
<li><a href="#orgc0c265c">1. Introduction</a>
<ul>
<li><a href="#orgf91c9af">1.1. The why</a>
<ul>
<li><a href="#orgc9d4eb4">Reproducibility</a></li>
<li><a href="#org4413478">Separation</a></li>
<li><a href="#org0e0484a">Modularity</a></li>
<li><a href="#orgabbdf2e">Organization</a></li>
<li><a href="#orge6bcba4">Maintainability</a></li>
</ul>
</li>
<li><a href="#orgfcbf920">1.2. The implementation</a>
<ul>
<li><a href="#org726bb9c">README.org</a></li>
<li><a href="#orgeb2bf24">Modules</a></li>
<li><a href="#org82f6d5b">Packages</a></li>
<li><a href="#org0aac26d">Deployment</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#orgafb5103">2. Autostart</a>
<ul>
<li><a href="#org01740ea">2.1. .config/autostart/autostart.desktop</a></li>
<li><a href="#orgc2b3367">2.2. .loginctl</a></li>
</ul>
</li>
<li><a href="#orga318560">3. Bash</a>
<ul>
<li><a href="#org0aa14ba">3.1. .bashrc</a></li>
<li><a href="#org7b4aae6">3.2. .bash profile</a></li>
</ul>
</li>
<li><a href="#org38eb3e9">4. Custom Binaries</a>
<ul>
<li><a href="#org9377eb9">4.1. .bin/scr</a></li>
<li><a href="#org5300dc7">4.2. .bin/scr-area</a></li>
<li><a href="#orgacd84ad">4.3. .bin/chromium-incognito</a></li>
</ul>
</li>
<li><a href="#orge025709">5. Containers</a>
<ul>
<li><a href="#orgf1cc7ba">5.1. .config/containers/policy.json</a></li>
<li><a href="#org70ed0cd">5.2. .config/containers/registries.conf</a></li>
</ul>
</li>
<li><a href="#orgad1c4dc">6. Dictionaries</a></li>
<li><a href="#orgeaf8eea">7. Debian Dependencies</a></li>
<li><a href="#org827ad2c">8. Firefox</a></li>
<li><a href="#orgc7bc935">9. Fonts</a></li>
<li><a href="#orgdb28c63">10. Gtk</a></li>
<li><a href="#org89f1771">11. Guix</a>
<ul>
<li><a href="#orga9d8836">11.1. .guix-manifest</a></li>
<li><a href="#orga5099a4">11.2. .guix-manifest-tiny</a></li>
<li><a href="#orgc96acba">11.3. .config/guix/channels.scm</a></li>
</ul>
</li>
<li><a href="#org67cb646">12. Guix-run</a>
<ul>
<li><a href="#orgb4d2ce9">12.1. .bin/guix-run</a></li>
</ul>
</li>
<li><a href="#orgf55bd1b">13. Sway</a>
<ul>
<li><a href="#orgd10b689">13.1. .config/sway/config</a></li>
<li><a href="#orgfa56d95">13.2. .config/sway/i3status wrapper.py</a></li>
<li><a href="#org1c195ad">13.3. .config/i3status/config</a></li>
</ul>
</li>
<li><a href="#orgf6283de">14. Icons</a></li>
<li><a href="#orgcbdec70">15. Rofi</a>
<ul>
<li><a href="#org381682c">15.1. .config/wofi/nord.rasi</a></li>
</ul>
</li>
<li><a href="#org20fa543">16. Startx</a>
<ul>
<li><a href="#org8b26d34">16.1. .startx</a></li>
</ul>
</li>
<li><a href="#orgb51cdea">17. Xresources</a>
<ul>
<li><a href="#orgfe6ae5e">17.1. .Xresources</a></li>
<li><a href="#org3eeab06">17.2. .xsessionrc</a></li>
</ul>
</li>
<li><a href="#org7a4fd63">18. XFCE 4 Terminal</a></li>
<li><a href="#orgc4e13c9">19. Wallpapers</a></li>
<li><a href="#orgf7cd2ff">20. Guix system</a>
<ul>
<li><a href="#org312d4fc">20.1. /etc/guix-systems/lainpad.scm</a></li>
<li><a href="#org6d75f98">20.2. /etc/guix-systems/signing-key.pub</a></li>
</ul>
</li>
<li><a href="#orgb840f06">21. Custom Guix Modules</a>
<ul>
<li><a href="#org57bd2f7">21.1. /etc/guix-modules/nil/packages</a>
<ul>
<li><a href="#orgc7d1907">21.1.1. brogue.scm</a></li>
<li><a href="#orge8cd6f4">21.1.2. distrobox-docker.scm</a></li>
<li><a href="#org59bd373">21.1.3. emulators.scm</a></li>
<li><a href="#org8665ce8">21.1.4. gnome.scm</a></li>
<li><a href="#org9a5d77c">21.1.5. throttled.scm</a></li>
</ul>
</li>
<li><a href="#org6f9ec07">21.2. /etc/guix-modules/nil/services</a>
<ul>
<li><a href="#org7913c9d">21.2.1. mount-rshared.scm</a></li>
<li><a href="#org0127e64">21.2.2. virsh.scm</a></li>
<li><a href="#org7d2436e">21.2.3. throttled.scm</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#org962dbc8">22. ZRAM on non-guix distros</a>
<ul>
<li><a href="#orgf70e0ce">22.1. /etc/modules-load.d/zram.conf</a></li>
<li><a href="#org962ed40">22.2. /etc/modprobe.d/zram.conf</a></li>
<li><a href="#orgf43531d">22.3. /etc/udev/rules.d/99-zram.rules</a></li>
<li><a href="#orgfc28fcc">22.4. /etc/systemd/system/zram.service</a></li>
</ul>
</li>
<li><a href="#orgd9dd44c">23. Emacs</a>
<ul>
<li><a href="#org5a24c7d">23.1. Initial variables</a></li>
<li><a href="#org1320aee">23.2. Packages</a></li>
<li><a href="#org18d2ddc">23.3. Extra tempel templates (.emacs.d/templates)</a></li>
<li><a href="#org9d250cc">23.4. custom-set options</a></li>
<li><a href="#org3f747d5">23.5. Variables</a></li>
<li><a href="#org395efbe">23.6. LSP servers</a></li>
<li><a href="#org50e6935">23.7. Functions</a></li>
<li><a href="#org68ac218">23.8. Keybindings</a></li>
<li><a href="#org3fbceb2">23.9. .exwm.el</a></li>
</ul>
</li>
<li><a href="#orgcde9b76">24. Non-Guix Services and dependencies</a></li>
</ul>
</div>
</div>
<p>
<b>Click <a href="https://raw.githack.com/lambdanil/emacs-stuff/main/README.html">here</a> for a properly formatted HTML version :)</b>
</p>
<p>
<i>Debian with EXWM</i>
</p>
<div id="org57ba672" class="figure">
<p><img src="./screenshots/exwm-scr.png" alt="exwm-scr.png" width="720px" />
</p>
</div>
<p>
<i>Debian with MATE</i>
</p>
<div id="org9cf5a69" class="figure">
<p><img src="./screenshots/debian-scr.png" alt="debian-scr.png" width="720px" />
</p>
</div>
<p>
<i>openSUSE Aeon with Gnome</i>
</p>
<div id="org4e28d22" class="figure">
<p><img src="./screenshots/microos-scr.png" alt="microos-scr.png" width="720px" />
</p>
</div>
<p>
All of these are different flavors of this configuration.
</p>
<div id="outline-container-orgc0c265c" class="outline-2">
<h2 id="orgc0c265c"><span class="section-number-2">1.</span> Introduction</h2>
<div class="outline-text-2" id="text-1">
<p>
This is my highly modular and entirely literate full-system configuration.
</p>
<p>
Let's talk about the implementation first - how I handle it and why.
</p>
</div>
<div id="outline-container-orgf91c9af" class="outline-3">
<h3 id="orgf91c9af"><span class="section-number-3">1.1.</span> The why</h3>
<div class="outline-text-3" id="text-1-1">
<p>
There are multiple important ideas in place here.
</p>
</div>
<div id="outline-container-orgc9d4eb4" class="outline-4">
<h4 id="orgc9d4eb4">Reproducibility</h4>
<div class="outline-text-4" id="text-orgc9d4eb4">
<p>
I should be able to deploy this configuration quickly and easily, achieving an identical (= reasonably close to identical) result every time.
Most importantly all of the relevant dotfiles should be present and should be set up in a way that allows them to work when deployed anywhere. Every file that is relevant to reproducing this configuration should be present.
To ensure this is the case I sometimes try to set up my environment in a virtual machine so that I can check if I missed any important files.
</p>
</div>
</div>
<div id="outline-container-org4413478" class="outline-4">
<h4 id="org4413478">Separation</h4>
<div class="outline-text-4" id="text-org4413478">
<p>
The user environment should exist almost entirely separately from the system environment.
</p>
</div>
</div>
<div id="outline-container-org0e0484a" class="outline-4">
<h4 id="org0e0484a">Modularity</h4>
<div class="outline-text-4" id="text-org0e0484a">
<p>
I should be able to easily pick which parts of the configuration I want to deploy.
</p>
</div>
</div>
<div id="outline-container-orgabbdf2e" class="outline-4">
<h4 id="orgabbdf2e">Organization</h4>
<div class="outline-text-4" id="text-orgabbdf2e">
<p>
There should be no confusion over how to deploy this system, nor should there be any confusion over where individual files belong, etc. All files should have their own clearly defined place.
</p>
</div>
</div>
<div id="outline-container-orge6bcba4" class="outline-4">
<h4 id="orge6bcba4">Maintainability</h4>
<div class="outline-text-4" id="text-orge6bcba4">
<p>
The configuration should be easy to keep current, it should also be robust and reliable.
</p>
</div>
</div>
</div>
<div id="outline-container-orgfcbf920" class="outline-3">
<h3 id="orgfcbf920"><span class="section-number-3">1.2.</span> The implementation</h3>
<div class="outline-text-3" id="text-1-2">
<p>
I'll start by outlining the structure, then I'll go over each step and explain its role.
</p>
</div>
<div id="outline-container-org726bb9c" class="outline-4">
<h4 id="org726bb9c">README.org</h4>
<div class="outline-text-4" id="text-org726bb9c">
<p>
The centerpiece of this implementation is the <code>README.org</code> file. This file includes all of the plaintext dotfiles that are part of this system, as well as information about every other file.
Using <code>org</code> to describe these files allows for the configuration to remain readable and properly organized. Each chapter in this file corresponds to a single "module" (more on these below).
</p>
<p>
This <code>org</code> file is then <code>tangled</code> into the <code>configs</code> directory, where the individual files are placed into separate directories, or as I called them above, "modules".
</p>
</div>
</div>
<div id="outline-container-orgeb2bf24" class="outline-4">
<h4 id="orgeb2bf24">Modules</h4>
<div class="outline-text-4" id="text-orgeb2bf24">
<p>
Each module is a group of files that fulfill a certain role.
These modules should be self-reliant and shouldn't depend on other modules. In practice there are a few exceptions - for example some modules rely on the <code>guix</code> module to ship dependencies.
Non-plaintext modules are also present in the <code>configs</code> directory. These aren't tangled but are still described in the <code>org</code> file.
These are mostly things that cannot be defined in plaintext such as fonts, icons, wallpapers and similar.
</p>
<p>
All of these modules are symlinked into the home directory using GNU Stow. Using the modules in this way allows picking out specific parts of the configuration.
</p>
</div>
</div>
<div id="outline-container-org82f6d5b" class="outline-4">
<h4 id="org82f6d5b">Packages</h4>
<div class="outline-text-4" id="text-org82f6d5b">
<p>
The GNU Guix package manager is used for installing dependencies. This means the dependencies for this environment can be installed anywhere where Guix can run, further separating the user environment from the rest of the system and ensuring better reliability.
</p>
</div>
</div>
<div id="outline-container-org0aac26d" class="outline-4">
<h4 id="org0aac26d">Deployment</h4>
<div class="outline-text-4" id="text-org0aac26d">
<ul class="org-ul">
<li><b>Make sure to tangle this file with <code>org-babel-tangle</code> to actually apply changes made to plaintext files</b>.</li>
<li>Install Guix and run a <code>guix pull</code> before importing Guix package manifests.</li>
<li>The guix manifest providing the bare minimum dependencies is part of the <code>guix</code> module and can be installed with <code>guix package -m $HOME/.guix-manifest-tiny</code></li>
<li>The configuration itself is placed in <code>~/git/emacs-stuff/configs</code> and <code>~/git/emacs-stuff/configs-root</code>
<ul class="org-ul">
<li><p>
From there individual modules can be installed:
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #006FE0;">cd</span> ./configs
<span style="color: #006DAF;">stow</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">module</span> <span style="color: #D0372D;">-t</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span>
<span style="color: #006FE0;">cd</span> ..
</pre>
</div></li>
<li><p>
Or all at once, overwriting existing:
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #006FE0;">cd</span> ./configs
<span style="color: #006DAF;">stow</span> * <span style="color: #D0372D;">-t</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span> <span style="color: #D0372D;">--adopt</span>
<span style="color: #006FE0;">cd</span> ..
<span style="color: #006DAF;">git</span> reset <span style="color: #D0372D;">--hard</span>
</pre>
</div></li>
<li>The <code>configs-root</code> directory contains system environment modules. Please ensure the permissions are set correctly.
<ul class="org-ul">
<li>These files should be linked into the root filesystem (<code>/</code>) instead of <code>$HOME</code>.</li>
</ul></li>
</ul></li>
</ul>
</div>
</div>
</div>
</div>
<div id="outline-container-orgafb5103" class="outline-2">
<h2 id="orgafb5103"><span class="section-number-2">2.</span> Autostart</h2>
<div class="outline-text-2" id="text-2">
<p>
Here I store my relevant autostart scripts.
</p>
</div>
<div id="outline-container-org01740ea" class="outline-3">
<h3 id="org01740ea"><span class="section-number-3">2.1.</span> .config/autostart/autostart.desktop</h3>
<div class="outline-text-3" id="text-2-1">
<p>
First we need to add a .desktop file for the DE to load.
</p>
<div class="org-src-container">
<pre class="src src-conf-desktop">[<span style="color: #6434A3;">Desktop Entry</span>]
<span style="color: #BA36A5;">Type</span>=Application
<span style="color: #BA36A5;">Name</span>=loginctl
<span style="color: #BA36A5;">Exec</span>=/home/nil/.loginctl
<span style="color: #BA36A5;">Comment</span>=Run loginctl script on login
<span style="color: #BA36A5;">X-GNOME-Autostart-enabled</span>=<span style="color: #D0372D;">true</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc2b3367" class="outline-3">
<h3 id="orgc2b3367"><span class="section-number-3">2.2.</span> .loginctl</h3>
<div class="outline-text-3" id="text-2-2">
<p>
Here's the actual autostart script.
</p>
<p>
For some reason Xwayland won't automatically read my Xresources, so I ensure they are read manually.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #006DAF;">xrdb</span> ~/git/emacs-stuff/configs/X/.Xresources
</pre>
</div>
<p>
I use Syncthing to sync my org agenda between different devices.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #8D8D84; font-style: italic;">#syncthing serve --no-browser &</span>
</pre>
</div>
<p>
Having an Emacs daemon means instant startup times for emacsclient.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #8D8D84; font-style: italic;"># $HOME/.local/bin/emacs --daemon &</span>
<span style="color: #006DAF;">emacs</span> <span style="color: #D0372D;">--daemon</span> &
</pre>
</div>
<p>
These are only necessary when using a standalone window manager.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #8D8D84; font-style: italic;"># nm-applet &</span>
<span style="color: #8D8D84; font-style: italic;"># xhost +si:localuser:nil</span>
<span style="color: #8D8D84; font-style: italic;"># $HOME/.guix-profile/libexec/xdg-desktop-portal -r &</span>
<span style="color: #006DAF;">dbus-update-activation-environment</span> <span style="color: #D0372D;">--all</span> &
<span style="color: #8D8D84; font-style: italic;"># xinput set-prop 'pointer:Logitech G305' 'libinput Accel Profile Enabled' 0 1 &</span>
<span style="color: #8D8D84; font-style: italic;"># /usr/bin/gnome-keyring-daemon --start --components=secrets &</span>
<span style="color: #8D8D84; font-style: italic;"># playerctld &</span>
</pre>
</div>
<p>
These are commands specifically only used when on my laptop.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span> <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOSTNAME</span><span style="color: #008000;">"</span> = <span style="color: #008000;">"lainpad"</span> <span style="color: #707183;">]</span>
<span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #006DAF;">setxkbmap</span> cz <span style="color: #D0372D;">-option</span> <span style="color: #008000;">'ctrl:swapcaps'</span> &
<span style="color: #006DAF;">xinput</span> set-prop <span style="color: #008000;">'pointer:Logitech G305'</span> <span style="color: #008000;">'Device Accel Profile'</span> <span style="color: #D0372D;">-1</span> &
<span style="color: #8D8D84; font-style: italic;"># echo "nothing to do!"</span>
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orga318560" class="outline-2">
<h2 id="orga318560"><span class="section-number-2">3.</span> Bash</h2>
<div class="outline-text-2" id="text-3">
<p>
Let's move on to configuring the shell - bash in my case.
</p>
</div>
<div id="outline-container-org0aa14ba" class="outline-3">
<h3 id="org0aa14ba"><span class="section-number-3">3.1.</span> .bashrc</h3>
<div class="outline-text-3" id="text-3-1">
<p>
I like to have a function to clear old guix builds by regex, helps keep the amount of garbage down.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #006699;">clean_build</span> <span style="color: #707183;">()</span> <span style="color: #707183;">{</span> <span style="color: #8D8D84; font-style: italic;"># clear guix build by regex</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #7388D6;">[</span><span style="color: #909183;">[</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">1</span> <span style="color: #909183;">]</span><span style="color: #7388D6;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #BA36A5; font-style: italic;">CLEAR_BUILD_PATHS</span>=<span style="color: #008000;">"</span><span style="color: #008000; font-weight: bold;">$(</span><span style="color: #006DAF; background-color: #FFFFFF;">ls</span><span style="color: #008000; background-color: #FFFFFF;"> </span><span style="color: #808080; background-color: #FFFFFF; font-weight: bold;">--color=never</span><span style="color: #008000; background-color: #FFFFFF;"> </span><span style="color: #D0372D; background-color: #FFFFFF;">-d</span><span style="color: #008000; background-color: #FFFFFF;"> /gnu/store/</span><span style="color: #0000FF; background-color: #FFFFFF; font-weight: bold;">$</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">1</span><span style="color: #008000; background-color: #FFFFFF;"> </span><span style="color: #0000FF; background-color: #FFFFFF; font-weight: bold;">|</span><span style="color: #008000; background-color: #FFFFFF;"> </span><span style="color: #006DAF; background-color: #FFFFFF;">tr</span><span style="color: #008000; background-color: #FFFFFF;"> '\n' ' '</span><span style="color: #008000; font-weight: bold;">)</span><span style="color: #008000;">"</span>
<span style="color: #0000FF; font-weight: bold;">else</span>
<span style="color: #006FE0;">echo</span> <span style="color: #008000;">"no regex specified"</span>
<span style="color: #006DAF;">return</span> 1
<span style="color: #0000FF; font-weight: bold;">fi</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #7388D6;">[</span><span style="color: #909183;">[</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #709870; font-weight: bold;">(</span><span style="color: #006FE0; background-color: #FFFFFF;">echo</span><span style="color: #333333; background-color: #FFFFFF;"> </span><span style="color: #008000; background-color: #FFFFFF;">"</span><span style="color: #0000FF; background-color: #FFFFFF; font-weight: bold;">$</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">CLEAR_BUILD_PATHS</span><span style="color: #008000; background-color: #FFFFFF;">"</span><span style="color: #333333; background-color: #FFFFFF;"> </span><span style="color: #0000FF; background-color: #FFFFFF; font-weight: bold;">|</span><span style="color: #333333; background-color: #FFFFFF;"> </span><span style="color: #006DAF; background-color: #FFFFFF;">wc</span><span style="color: #333333; background-color: #FFFFFF;"> </span><span style="color: #D0372D; background-color: #FFFFFF;">-c</span><span style="color: #709870; font-weight: bold;">)</span> -ne 1 <span style="color: #909183;">]</span><span style="color: #7388D6;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #006DAF;">guix</span> gc <span style="color: #D0372D;">--delete</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">CLEAR_BUILD_PATHS</span>
<span style="color: #0000FF; font-weight: bold;">else</span>
<span style="color: #006FE0;">echo</span> <span style="color: #008000;">"no match for regex found"</span>
<span style="color: #006DAF;">return</span> 1
<span style="color: #0000FF; font-weight: bold;">fi</span>
<span style="color: #707183;">}</span>
</pre>
</div>
<p>
A small bit used to remind me when I'm inside a Guix environment.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span> -n <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">GUIX_ENVIRONMENT</span><span style="color: #008000;">"</span> <span style="color: #707183;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span><span style="color: #7388D6;">[</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">PS1</span> =~ <span style="color: #909183;">(</span>.*<span style="color: #909183;">)</span>"\\$" <span style="color: #7388D6;">]</span><span style="color: #707183;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #BA36A5; font-style: italic;">PS1</span>=<span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">${</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">BASH_REMATCH</span><span style="color: #333333; background-color: #FFFFFF;">[1]</span><span style="color: #0000FF; font-weight: bold;">}</span><span style="color: #008000;"> [env]\\\$ "</span>
<span style="color: #0000FF; font-weight: bold;">fi</span>
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
<p>
Set up the prompt with fancy colors and a cute lambda.
In case <code>tput</code> (part of <code>ncurses</code>) isn't available an alternative is provided.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span><span style="color: #7388D6;">[</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #ff0000; font-weight: bold;">-</span> <span style="color: #0000FF; font-weight: bold;">==</span> *i* <span style="color: #7388D6;">]</span><span style="color: #707183;">]</span>
<span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #BA36A5; font-style: italic;">_GREEN</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> setaf 2</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #BA36A5; font-style: italic;">_MAGENTA</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> setaf 207</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #BA36A5; font-style: italic;">_BLUE</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> setaf 4</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #BA36A5; font-style: italic;">_RED</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> setaf 1</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #BA36A5; font-style: italic;">_CYAN</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> setaf 45</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #BA36A5; font-style: italic;">_RESET</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> sgr0</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #BA36A5; font-style: italic;">_BOLD</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">tput</span><span style="color: #333333; background-color: #FFFFFF;"> bold</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #8D8D84; font-style: italic;"># _GREEN="\e[0;32m"</span>
<span style="color: #8D8D84; font-style: italic;"># _MAGENTA="\e[0;35m"</span>
<span style="color: #8D8D84; font-style: italic;"># _BLUE="\e[0;34m"</span>
<span style="color: #8D8D84; font-style: italic;"># _RED="\e[0;31m"</span>
<span style="color: #8D8D84; font-style: italic;"># _CYAN="\e[0;36m"</span>
<span style="color: #8D8D84; font-style: italic;"># _RESET="\e[0m"</span>
<span style="color: #8D8D84; font-style: italic;"># _BOLD="\e[1m"</span>
<span style="color: #8D8D84; font-style: italic;"># export LD_LIBRARY_PATH=$LIBRARY_PATH</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">PS1</span>=<span style="color: #008000;">"[</span><span style="color: #0000FF; font-weight: bold;">${</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">_MAGENTA</span><span style="color: #0000FF; font-weight: bold;">}</span><span style="color: #008000;">\u</span><span style="color: #0000FF; font-weight: bold;">${</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">_RESET</span><span style="color: #0000FF; font-weight: bold;">}</span><span style="color: #008000;">@</span><span style="color: #0000FF; font-weight: bold;">${</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">_CYAN</span><span style="color: #0000FF; font-weight: bold;">}</span><span style="color: #008000;">\h</span><span style="color: #0000FF; font-weight: bold;">${</span><span style="color: #D0372D; background-color: #FFFFFF; font-style: italic;">_RESET</span><span style="color: #0000FF; font-weight: bold;">}</span><span style="color: #008000;">] \t\n(\w) λ "</span>
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
<p>
Guix needs to be separately sourced in non-container interactive shells.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span> ! -f /.dockerenv <span style="color: #707183;">]</span> <span style="color: #0000FF; font-weight: bold;">&&</span> <span style="color: #707183;">[</span> ! -f /run/.containerenv <span style="color: #707183;">]</span> <span style="color: #0000FF; font-weight: bold;">&&</span> <span style="color: #707183;">[</span> -d <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.guix-profile"</span> <span style="color: #707183;">]</span> <span style="color: #0000FF; font-weight: bold;">&&</span> <span style="color: #707183;">[</span><span style="color: #7388D6;">[</span> <span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #ff0000; font-weight: bold;">-</span> <span style="color: #0000FF; font-weight: bold;">==</span> *i* <span style="color: #7388D6;">]</span><span style="color: #707183;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #BA36A5; font-style: italic;">GUIX_PROFILE</span>=<span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.guix-profile"</span>
<span style="color: #006DAF;">.</span> <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">GUIX_PROFILE</span><span style="color: #008000;">/etc/profile"</span>
<span style="color: #BA36A5; font-style: italic;">GUIX_PROFILE</span>=<span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.config/guix/current"</span>
<span style="color: #006DAF;">.</span> <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">GUIX_PROFILE</span><span style="color: #008000;">/etc/profile"</span>
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
<p>
Add some aliases.
The <code>ld_libs</code> is useful for exporting Guix's libraries to run precompiled software.
</p>
<div class="org-src-container">
<pre class="src src-bash"> <span style="color: #006FE0;">alias</span> sudo=<span style="color: #008000;">"sudo -p \"[sudo] what's youw p-pa-password, Nil-chan?~ ❤️ \" "</span>
<span style="color: #8D8D84; font-style: italic;"># alias apt="nala"</span>
<span style="color: #006FE0;">alias</span> ls=<span style="color: #008000;">"ls --color"</span>
<span style="color: #006FE0;">alias</span> ld_libs=<span style="color: #008000;">"export LD_LIBRARY_PATH=\$LIBRARY_PATH"</span>
<span style="color: #006FE0;">alias</span> tf=<span style="color: #008000;">"xrandr --output HDMI-A-1 --set TearFree"</span>
<span style="color: #006FE0;">alias</span> hyfetch=<span style="color: #008000;">"hyfetch --ascii-file ~/git/neofetch-logo"</span>
<span style="color: #006FE0;">alias</span> deb=<span style="color: #008000;">"xhost +si:localuser:nil && distrobox enter debian --"</span>
<span style="color: #006FE0;">alias</span> glibc=<span style="color: #008000;">"bwrap --bind /var/chroots/debian / --dev /dev --proc /proc --bind /sys /sys --ro-bind /sys/dev/char /sys/dev/char --ro-bind /sys/devices/pci0000:00 /sys/devices/pci0000:00 --bind /run /run --bind /home /home --ro-bind /dev/dri /dev/dri --ro-bind /etc/resolv.conf /etc/resolv.conf --ro-bind /etc/passwd /etc/passwd --ro-bind /etc/group /etc/group"</span>
<span style="color: #006FE0;">alias</span> glibc-root=<span style="color: #008000;">"doas chroot /var/chroots/debian /bin/bash"</span>
<span style="color: #006FE0;">alias</span> reconf=<span style="color: #008000;">"sudo -E guix system reconfigure /etc/guix-systems/</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOSTNAME</span><span style="color: #008000;">.scm"</span>
</pre>
</div>
<p>
Finally some variable exports - for Guix and Flatpak and a silly <code>sudo</code> prompt.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">XDG_DATA_DIRS</span>=<span style="color: #008000;">"/var/lib/flatpak/exports/share:</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.local/share/flatpak/exports/share:</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">XDG_DATA_DIRS</span><span style="color: #008000;">"</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">GUIX_PACKAGE_PATH</span>=<span style="color: #008000;">"/etc/guix-modules"</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">SUDO_PROMPT</span>=<span style="color: #008000;">'[sudo] what'</span>\'<span style="color: #008000;">'s youw p-pa-password, Nil-chan?~ ❤️ '</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org7b4aae6" class="outline-3">
<h3 id="org7b4aae6"><span class="section-number-3">3.2.</span> .bash profile</h3>
<div class="outline-text-3" id="text-3-2">
<p>
Let's move onto the bash profile, used in login shells.
</p>
<p>
First run the bashrc if necessary.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #8D8D84; font-style: italic;"># Honor per-interactive-shell startup file</span>
<span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span> -f ~/.bashrc <span style="color: #707183;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span> <span style="color: #006DAF;">.</span> ~/.bashrc<span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">fi</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">LANG</span>=cs_CZ.utf-8
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #ff0000; font-weight: bold; font-style: italic;">PATH</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #ff0000; font-weight: bold; font-style: italic;">PATH</span>:$HOME/.local/bin:<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span>/.bin:$HOME/.py/bin:/usr/lib/go-1.22/bin
</pre>
</div>
<p>
Then we can go ahead and export Guix, but only when not inside a container. I also verify the Guix profile exists before trying to load it.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span> ! -f /.dockerenv <span style="color: #707183;">]</span> <span style="color: #0000FF; font-weight: bold;">&&</span> <span style="color: #707183;">[</span> ! -f /run/.containerenv <span style="color: #707183;">]</span> <span style="color: #0000FF; font-weight: bold;">&&</span> <span style="color: #707183;">[</span> -d <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.guix-profile"</span> <span style="color: #707183;">]</span><span style="color: #0000FF; font-weight: bold;">;</span> <span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #8D8D84; font-style: italic;"># source "$HOME/.guix-profile/etc/profile"</span>
<span style="color: #8D8D84; font-style: italic;"># source "$HOME/.config/guix/current/etc/profile"</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #ff0000; font-weight: bold; font-style: italic;">PATH</span>=<span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #ff0000; font-weight: bold; font-style: italic;">PATH</span><span style="color: #008000;">:</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.guix-profile/bin"</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">XDG_DATA_DIRS</span>=<span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">XDG_DATA_DIRS</span><span style="color: #008000;">:</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.guix-profile/share"</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">GUIX_LOCPATH</span>=<span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOME</span><span style="color: #008000;">/.guix-profile/lib/locale"</span>
<span style="color: #8D8D84; font-style: italic;"># export GUIX_SANDBOX_EXTRA_SHARES="/mnt/media/nil/external/Steam"</span>
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
<p>
Laptop-specific environment variables to ensure hardware video acceleration works.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span> <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">HOSTNAME</span><span style="color: #008000;">"</span> = <span style="color: #008000;">"lainpad"</span> <span style="color: #707183;">]</span> <span style="color: #0000FF; font-weight: bold;">&&</span> <span style="color: #707183;">[</span> ! -f /run/.containerenv <span style="color: #707183;">]</span>
<span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">LIBVA_DRIVER_NAME</span>=iHD
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">LD_PRELOAD</span>=/home/nil/.guix-profile/lib/dri/iHD_drv_video.so
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">MOZ_USE_XINPUT2</span>=1
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
<p>
This makes sway start up automatically when logging into <code>tty2</code>, eliminating the need for a login manager.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #0000FF; font-weight: bold;">if</span> <span style="color: #707183;">[</span><span style="color: #7388D6;">[</span> <span style="color: #008000;">"</span><span style="color: #008000; font-weight: bold;">$(</span><span style="color: #006DAF; background-color: #FFFFFF;">tty</span><span style="color: #008000; font-weight: bold;">)</span><span style="color: #008000;">"</span> <span style="color: #0000FF; font-weight: bold;">==</span> <span style="color: #008000;">"/dev/tty2"</span> <span style="color: #7388D6;">]</span><span style="color: #707183;">]</span>
<span style="color: #0000FF; font-weight: bold;">then</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">XDG_CURRENT_DESKTOP</span>=sway
<span style="color: #006DAF;">exec</span> dbus-run-session <span style="color: #D0372D;">--</span> sway
<span style="color: #0000FF; font-weight: bold;">fi</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org38eb3e9" class="outline-2">
<h2 id="org38eb3e9"><span class="section-number-2">4.</span> Custom Binaries</h2>
<div class="outline-text-2" id="text-4">
<p>
Here I have some custom binaries, mostly scripts and stuff.
</p>
</div>
<div id="outline-container-org9377eb9" class="outline-3">
<h3 id="org9377eb9"><span class="section-number-3">4.1.</span> .bin/scr</h3>
<div class="outline-text-3" id="text-4-1">
<p>
Just a screenshot shortcut.
</p>
<div class="org-src-container">
<pre class="src src-sh"><span style="color: #006DAF;">grim</span> <span style="color: #D0372D;">-</span> <span style="color: #0000FF; font-weight: bold;">|</span> <span style="color: #006DAF;">wl-copy</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org5300dc7" class="outline-3">
<h3 id="org5300dc7"><span class="section-number-3">4.2.</span> .bin/scr-area</h3>
<div class="outline-text-3" id="text-4-2">
<p>
…And the same but for a selected area.
</p>
<div class="org-src-container">
<pre class="src src-sh"><span style="color: #006DAF;">grim</span> <span style="color: #D0372D;">-g</span> <span style="color: #008000;">"</span><span style="color: #008000; font-weight: bold;">$(</span><span style="color: #006DAF; background-color: #FFFFFF;">slurp</span><span style="color: #008000; font-weight: bold;">)</span><span style="color: #008000;">"</span> <span style="color: #D0372D;">-</span> <span style="color: #0000FF; font-weight: bold;">|</span> <span style="color: #006DAF;">wl-copy</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgacd84ad" class="outline-3">
<h3 id="orgacd84ad"><span class="section-number-3">4.3.</span> .bin/chromium-incognito</h3>
<div class="outline-text-3" id="text-4-3">
<p>
And a shortcut for opening chromium in incognito mode.
</p>
<div class="org-src-container">
<pre class="src src-sh"><span style="color: #006DAF;">chromium</span> <span style="color: #D0372D;">--incognito</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orge025709" class="outline-2">
<h2 id="orge025709"><span class="section-number-2">5.</span> Containers</h2>
<div class="outline-text-2" id="text-5">
<p>
I use distrobox docker/podman (depending on which is available, podman is prefered) on my installation.
Here is some necessary configs for the containers.
</p>
</div>
<div id="outline-container-orgf1cc7ba" class="outline-3">
<h3 id="orgf1cc7ba"><span class="section-number-3">5.1.</span> .config/containers/policy.json</h3>
<div class="outline-text-3" id="text-5-1">
<p>
This isn't super secure.
</p>
<div class="org-src-container">
<pre class="src src-json"><span style="color: #707183; background-color: #FFFFFF;">{</span>
<span style="color: #0000FF; font-weight: bold;">"default"</span>: <span style="color: #7388D6; background-color: #FFFFFF;">[</span>
<span style="color: #909183; background-color: #FFFFFF;">{</span>
<span style="color: #0000FF; font-weight: bold;">"type"</span>: <span style="color: #008000;">"insecureAcceptAnything"</span>
<span style="color: #909183; background-color: #FFFFFF;">}</span>
<span style="color: #7388D6; background-color: #FFFFFF;">]</span>,
<span style="color: #0000FF; font-weight: bold;">"transports"</span>:
<span style="color: #7388D6; background-color: #FFFFFF;">{</span>
<span style="color: #0000FF; font-weight: bold;">"docker-daemon"</span>:
<span style="color: #909183; background-color: #FFFFFF;">{</span>
<span style="color: #0000FF; font-weight: bold;">""</span>: <span style="color: #709870; background-color: #FFFFFF;">[</span><span style="color: #907373; background-color: #FFFFFF;">{</span><span style="color: #0000FF; font-weight: bold;">"type"</span>:<span style="color: #008000;">"insecureAcceptAnything"</span><span style="color: #907373; background-color: #FFFFFF;">}</span><span style="color: #709870; background-color: #FFFFFF;">]</span>
<span style="color: #909183; background-color: #FFFFFF;">}</span>
<span style="color: #7388D6; background-color: #FFFFFF;">}</span>
<span style="color: #707183; background-color: #FFFFFF;">}</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org70ed0cd" class="outline-3">
<h3 id="org70ed0cd"><span class="section-number-3">5.2.</span> .config/containers/registries.conf</h3>
<div class="outline-text-3" id="text-5-2">
<p>
Add the necessary registries.
</p>
<div class="org-src-container">
<pre class="src src-conf-unix"><span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">Copied from https://raw.githubusercontent.com/projectatomic/registries/master/registries.fedora</span>
[<span style="color: #6434A3;">registries.search</span>]
<span style="color: #BA36A5;">registries</span> = [<span style="color: #008000;">'docker.io'</span>, <span style="color: #008000;">'registry.fedoraproject.org'</span>, <span style="color: #008000;">'registry.access.redhat.com'</span>]
[<span style="color: #6434A3;">registries.insecure</span>]
<span style="color: #BA36A5;">registries</span> = []
<span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">Docker only</span>
[<span style="color: #6434A3;">registries.block</span>]
<span style="color: #BA36A5;">registries</span> = []
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgad1c4dc" class="outline-2">
<h2 id="orgad1c4dc"><span class="section-number-2">6.</span> Dictionaries</h2>
<div class="outline-text-2" id="text-6">
<p>
This module provides the Czech hunspell dictionary since it currently isn't available in Guix.
The files were taken from the <a href="https://github.com/LibreOffice/dictionaries">LibreOffice dictionaries repository</a>.
</p>
</div>
</div>
<div id="outline-container-orgeaf8eea" class="outline-2">
<h2 id="orgeaf8eea"><span class="section-number-2">7.</span> Debian Dependencies</h2>
<div class="outline-text-2" id="text-7">
<p>
My long distrohopping journey has eventually landed me on Debian, which is the system I choose to run nowadays.
In order to simplify deploying my configuration on new Debian installations I've decided to add a simple list of <code>apt</code>-installable dependencies.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #006DAF;">sudo</span> apt install xinput git stow gcc sbcl guile-3.0 libtool-bin clang cmake make libenchant-2-dev
</pre>
</div>
<p>
Emacs is installed separately from the backports.
</p>
<div class="org-src-container">
<pre class="src src-bash"><span style="color: #006DAF;">sudo</span> apt install emacs <span style="color: #D0372D;">-t</span> bookworm-backports
</pre>
</div>
</div>
</div>
<div id="outline-container-org827ad2c" class="outline-2">
<h2 id="org827ad2c"><span class="section-number-2">8.</span> Firefox</h2>
<div class="outline-text-2" id="text-8">
<p>
This module provides my Firefox configuration. For tree style tab it's necessary to import <code>$HOME/.mozilla/firefox/default/treestyletab.css</code>.
</p>
</div>
</div>
<div id="outline-container-orgc7bc935" class="outline-2">
<h2 id="orgc7bc935"><span class="section-number-2">9.</span> Fonts</h2>
<div class="outline-text-2" id="text-9">
<p>
This module provides the necessary fonts.
</p>
</div>
</div>
<div id="outline-container-orgdb28c63" class="outline-2">
<h2 id="orgdb28c63"><span class="section-number-2">10.</span> Gtk</h2>
<div class="outline-text-2" id="text-10">
<p>
This module provides straightforward GTK3 configuration.
</p>
<div class="org-src-container">
<pre class="src src-conf-unix">[<span style="color: #6434A3;">Settings</span>]
<span style="color: #BA36A5;">gtk-cursor-theme-name</span>=Simp1e-Adw
<span style="color: #BA36A5;">gtk-icon-theme-name</span>=Papirus-Dark
<span style="color: #BA36A5;">gtk-theme-name</span>=Dracula
<span style="color: #BA36A5;">gtk-font-name</span>=Noto Sans 10
<span style="color: #BA36A5;">gtk-application-prefer-dark-theme</span>=1
</pre>
</div>
<p>
This adds a bit of padding to the XFCE terminal.
</p>
<div class="org-src-container">
<pre class="src src-css"><span style="color: #006FE0;">VteTerminal</span><span style="color: #333333; background-color: #FFFFFF;">,</span> <span style="color: #006FE0;">vte-terminal</span> <span style="color: #707183; background-color: #FFFFFF;">{</span>
<span style="color: #D0372D; font-style: italic;">padding</span><span style="color: #333333; background-color: #FFFFFF;">:</span> <span style="color: #D0372D;">8</span><span style="color: #008000;">px</span><span style="color: #333333; background-color: #FFFFFF;">;</span>
<span style="color: #707183; background-color: #FFFFFF;">}</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-org89f1771" class="outline-2">
<h2 id="org89f1771"><span class="section-number-2">11.</span> Guix</h2>
<div class="outline-text-2" id="text-11">
<p>
<b>This module depends on the <code>guix-modules</code> module for certain package definitions!</b>
GNU Guix is a very important part of my configuration.
</p>
</div>
<div id="outline-container-orga9d8836" class="outline-3">
<h3 id="orga9d8836"><span class="section-number-3">11.1.</span> .guix-manifest</h3>
<div class="outline-text-3" id="text-11-1">
<p>
Just a straightforward (and very messy!) package manifest. I have decided to keep this as a separate file rather than tangle it. This allows me to use <code>guix package --export-manifest</code> to update it.
</p>
</div>
</div>
<div id="outline-container-orga5099a4" class="outline-3">
<h3 id="orga5099a4"><span class="section-number-3">11.2.</span> .guix-manifest-tiny</h3>
<div class="outline-text-3" id="text-11-2">
<p>
Due to the above manifest becoming rather bloated a minimal replacement is provided here. This includes only the necessary dependencies to get the system running correctly.
</p>
<div class="org-src-container">
<pre class="src src-scheme"><span style="color: #707183;">(</span>specifications->manifest
<span style="color: #7388D6;">(</span>list <span style="color: #008000;">"glibc-locales"</span>
<span style="color: #008000;">"gcc"</span>
<span style="color: #008000;">"syncthing"</span>
<span style="color: #008000;">"sbcl"</span>
<span style="color: #008000;">"guile"</span>
<span style="color: #008000;">"cmake"</span>
<span style="color: #008000;">"make"</span>
<span style="color: #008000;">"emacs"</span>
<span style="color: #008000;">"hunspell-dict-en-us"</span>
<span style="color: #008000;">"enchant"</span><span style="color: #7388D6;">)</span><span style="color: #707183;">)</span>
</pre>
</div>
</div>
</div>
<div id="outline-container-orgc96acba" class="outline-3">
<h3 id="orgc96acba"><span class="section-number-3">11.3.</span> .config/guix/channels.scm</h3>
<div class="outline-text-3" id="text-11-3">
<p>
Here is the setup for channels, additions here are <code>nonguix</code> and <code>guix-gaming-channels</code>.
</p>
<div class="org-src-container">
<pre class="src src-scheme"><span style="color: #707183;">(</span><span style="color: #0000FF; font-weight: bold;">use-modules</span> <span style="color: #7388D6;">(</span>guix ci<span style="color: #7388D6;">)</span><span style="color: #707183;">)</span>
<span style="color: #707183;">(</span>cons* <span style="color: #7388D6;">(</span>channel-with-substitutes-available
%default-guix-channel
<span style="color: #008000;">"https://ci.guix.gnu.org"</span><span style="color: #7388D6;">)</span>
<span style="color: #7388D6;">(</span>channel
<span style="color: #909183;">(</span>name 'nonguix<span style="color: #909183;">)</span>
<span style="color: #909183;">(</span>url <span style="color: #008000;">"https://gitlab.com/nonguix/nonguix"</span><span style="color: #909183;">)</span>
<span style="color: #8D8D84; font-style: italic;">;; </span><span style="color: #8D8D84; font-style: italic;">Enable signature verification:</span>
<span style="color: #909183;">(</span>introduction
<span style="color: #709870;">(</span>make-channel-introduction
<span style="color: #008000;">"897c1a470da759236cc11798f4e0a5f7d4d59fbc"</span>
<span style="color: #907373;">(</span>openpgp-fingerprint
<span style="color: #008000;">"2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"</span><span style="color: #907373;">)</span><span style="color: #709870;">)</span><span style="color: #909183;">)</span><span style="color: #7388D6;">)</span>
<span style="color: #7388D6;">(</span>channel
<span style="color: #909183;">(</span>name 'guix-gaming-games<span style="color: #909183;">)</span>
<span style="color: #909183;">(</span>url <span style="color: #008000;">"https://gitlab.com/guix-gaming-channels/games.git"</span><span style="color: #909183;">)</span>
<span style="color: #8D8D84; font-style: italic;">;; </span><span style="color: #8D8D84; font-style: italic;">Enable signature verification:</span>
<span style="color: #909183;">(</span>introduction
<span style="color: #709870;">(</span>make-channel-introduction
<span style="color: #008000;">"c23d64f1b8cc086659f8781b27ab6c7314c5cca5"</span>
<span style="color: #907373;">(</span>openpgp-fingerprint
<span style="color: #008000;">"50F3 3E2E 5B0C 3D90 0424 ABE8 9BDC F497 A4BB CC7F"</span><span style="color: #907373;">)</span><span style="color: #709870;">)</span><span style="color: #909183;">)</span><span style="color: #7388D6;">)</span>
%default-channels<span style="color: #707183;">)</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-org67cb646" class="outline-2">
<h2 id="org67cb646"><span class="section-number-2">12.</span> Guix-run</h2>
<div class="outline-text-2" id="text-12">
<p>
<code>guix-run</code> is a tiny script I originally found on Github. Unfortunately I do not have the original link anymore.
</p>
</div>
<div id="outline-container-orgb4d2ce9" class="outline-3">
<h3 id="orgb4d2ce9"><span class="section-number-3">12.1.</span> .bin/guix-run</h3>
<div class="outline-text-3" id="text-12-1">
<div class="org-src-container">
<pre class="src src-sh"><span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">LD_LIBRARY_PATH</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">LIBRARY_PATH</span>
<span style="color: #BA36A5; font-style: italic;">RUNNER</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #707183; font-weight: bold;">(</span><span style="color: #006DAF; background-color: #FFFFFF;">find</span><span style="color: #333333; background-color: #FFFFFF;"> ~/.guix-profile/lib/ </span><span style="color: #D0372D; background-color: #FFFFFF;">-name</span><span style="color: #333333; background-color: #FFFFFF;"> </span><span style="color: #008000; background-color: #FFFFFF;">'ld-linux-*.so*'</span><span style="color: #707183; font-weight: bold;">)</span>
<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">RUNNER</span> <span style="color: #008000;">"</span><span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #ff0000; font-weight: bold;">@</span><span style="color: #008000;">"</span> <span style="color: #8D8D84; font-style: italic;">#!/bin/sh</span>
<span style="color: #0000FF; font-weight: bold;">export</span> <span style="color: #BA36A5; font-style: italic;">LD_LIBRARY_PATH</span>=<span style="color: #0000FF; font-weight: bold;">$</span><span style="color: #D0372D; font-style: italic;">LIBRARY_PATH</span>
<span style="color: #006DAF;">RUNNER</span>
</pre>
</div>
</div>
</div>
</div>
<div id="outline-container-orgf55bd1b" class="outline-2">
<h2 id="orgf55bd1b"><span class="section-number-2">13.</span> Sway</h2>
<div class="outline-text-2" id="text-13">
<p>
<code>Sway</code> is one of the window managers I have a full setup for. While I do usually prefer to use a DE or EXWM, I do have sway here for completeness.
</p>
</div>
<div id="outline-container-orgd10b689" class="outline-3">
<h3 id="orgd10b689"><span class="section-number-3">13.1.</span> .config/sway/config</h3>
<div class="outline-text-3" id="text-13-1">
<p>
Set some initial variables first.
</p>
<div class="org-src-container">
<pre class="src src-conf-space"><span style="color: #BA36A5;">set</span> $mod Mod4
<span style="color: #BA36A5;">set</span> $HOME /home/nil
<span style="color: #8D8D84; font-style: italic;">#</span><span style="color: #8D8D84; font-style: italic;">set $term emacsclient -c -e "(let ((current-prefix-arg '(4))) (call-interactively 'vterm))"</span>
<span style="color: #BA36A5;">set</span> $term xfce4-terminal
<span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">set $files emacsclient -c -e '(dired "~")'</span>
<span style="color: #BA36A5;">set</span> $files thunar
<span style="color: #BA36A5;">set</span> $wallpaper $HOME/.local/share/wallpapers/deijurj-adfa3118-4bd6-4350-b9db-43d4d835536c.jpg
<span style="color: #BA36A5;">set</span> $lock swaylock -i $wallpaper
<span style="color: #BA36A5;">set</span> $scr_off swaymsg <span style="color: #008000;">"output * dpms off"</span>
<span style="color: #BA36A5;">set</span> $scr_on swaymsg <span style="color: #008000;">"output * dpms on"</span>
<span style="color: #BA36A5;">font</span> pango:Fira Code 9
<span style="color: #BA36A5;">gaps</span> inner 8px
<span style="color: #BA36A5;">for_window</span> [class=<span style="color: #008000;">"^.*"</span>] border pixel 2
<span style="color: #BA36A5;">floating_modifier</span> $mod
<span style="color: #BA36A5;">seat</span> seat0 xcursor_theme Breeze_Snow
<span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">tiling_drag modifier titlebar</span>
</pre>
</div>
<p>
Configure input.
</p>
<div class="org-src-container">
<pre class="src src-conf-space"><span style="color: #6434A3;">input *</span> {
<span style="color: #BA36A5;">xkb_layout</span> <span style="color: #008000;">"cz"</span>
<span style="color: #BA36A5;">xkb_options</span> <span style="color: #008000;">"ctrl:swapcaps"</span>
<span style="color: #BA36A5;">accel_profile</span> flat
<span style="color: #BA36A5;">xkb_numlock</span> enabled
<span style="color: #BA36A5;">}</span>
</pre>
</div>
<p>
Window rules for transparency, etc.
</p>
<div class="org-src-container">
<pre class="src src-conf-space"><span style="color: #BA36A5;">for_window</span> [app_id=<span style="color: #008000;">"thunar"</span>] opacity 0.96
</pre>
</div>
<p>
I decrease the time to render a frame as much as possible (12ms in this case), this significantly helps eliminate input lag. This value needs to be increased if stuttering becomes an issue.
</p>
<div class="org-src-container">
<pre class="src src-conf-space"><span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">output HDMI-A-2 max_render_time 12</span>
<span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">output HDMI-A-1 disable</span>
<span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">swaymsg -t get_outputs</span>
</pre>
</div>
<p>
Execute the startup environment, this is necessary for XDG autostart files.
</p>
<div class="org-src-container">
<pre class="src src-conf-space"><span style="color: #BA36A5;">exec</span> dbus-update-activation-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK
<span style="color: #BA36A5;">exec</span> --no-startup-id $HOME/.loginctl
<span style="color: #BA36A5;">exec</span> --no-startup-id swaybg -i $wallpaper
<span style="color: #BA36A5;">exec</span> --no-startup-id gsettings set org.gnome.desktop.interface gtk-theme Yaru-magenta-dark
<span style="color: #BA36A5;">exec</span> --no-startup-id gsettings set org.gnome.desktop.interface icon-theme Yaru-magenta-dark
<span style="color: #8D8D84; font-style: italic;"># </span><span style="color: #8D8D84; font-style: italic;">exec /usr/libexec/polkit-gnome-authentication-agent-1</span>
</pre>
</div>
<p>
Configure <code>swaylock</code> to start automatically.
</p>
<div class="org-src-container">
<pre class="src src-conf-space"><span style="color: #BA36A5;">exec</span> --no-startup-id swayidle timeout 480 <span style="color: #008000;">'$lock'</span> timeout 600 <span style="color: #008000;">'$scr_off'</span> resume <span style="color: #008000;">'$scr_on'</span>
</pre>
</div>
<p>
Now assigning some keybindings; all of these are rather self-explanatory.
</p>
<div class="org-src-container">