~unmatched-paren/conf

conf/home.scm -rw-r--r-- 8.4 KiB
af4c0e5b( [home] switch to guix's aerc 4 days ago
                                                                                
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
;;;; ('s dotfiles
;;;;
;;;; See the COPYRIGHT file for copying terms.

;;;; -*- mode: guile -*-

(use-modules
  (gnu home)
  (gnu home services)
  (gnu home services desktop)
  (gnu home services pm)
  (gnu home services shells)
  (gnu packages)
  (gnu packages admin)
  (gnu packages bootloaders)
  (gnu packages build-tools)
  (gnu packages compression)
  (gnu packages cpp)
  (gnu packages databases)
  (gnu packages emacs)
  (gnu packages emacs-xyz)
  (gnu packages fonts)
  (gnu packages freedesktop)
  (gnu packages game-development)
  (gnu packages games)
  (gnu packages gdb)
  (gnu packages gnome)
  (gnu packages gnupg)
  (gnu packages guile)
  (gnu packages image)
  (gnu packages image-viewers)
  (gnu packages linux)
  (gnu packages lisp)
  (gnu packages lua)
  (gnu packages mail)
  (gnu packages man)
  (gnu packages minetest)
  (gnu packages moreutils)
  (gnu packages ncurses)
  (gnu packages ocaml)
  (gnu packages pdf)
  (gnu packages pulseaudio)
  (gnu packages pv)
  (gnu packages python)
  (gnu packages python-xyz)
  (gnu packages qt)
  (gnu packages rust-apps)
  (gnu packages sdl)
  (gnu packages shells)
  (gnu packages ssh)
  (gnu packages terminals)
  (gnu packages text-editors)
  (gnu packages version-control)
  (gnu packages video)
  (gnu packages web-browsers)
  (gnu packages wm)
  (gnu packages xdisorg)
  (gnu services)
  (guixrus home services emacs)
  (guixrus home services foot)
  (guixrus home services himitsu)
  (guixrus home services himitsu-ssh)
  (guixrus home services mako)
  (guixrus packages common python)
  (guixrus packages emacs)
  (guixrus packages senpai)
  (guix build-system copy)
  (guix build-system python)
  (guix download)
  (guix gexp)
  (guix git-download)
  ((guix licenses) #:prefix license:)
  (guix packages)
  (guix transformations)
  (guix utils)
  (ice-9 format)
  (ice-9 match)
  (ice-9 popen)
  (ice-9 textual-ports))

(primitive-load (string-append (dirname (current-filename))
                               "/common.scm"))

(define local/emacs-rec-mode
  (package
    (inherit emacs-rec-mode)
    (arguments
     (substitute-keyword-arguments
         (package-arguments emacs-rec-mode)
       ((#:phases phases)
        #~(modify-phases #$phases
            (add-after 'unpack 'patch-program-paths
              (lambda* (#:key inputs #:allow-other-keys)
                (emacs-substitute-variables "rec-mode.el"
                  ("rec-recfix" (search-input-file inputs "bin/recfix"))
                  ("rec-recinf" (search-input-file inputs "bin/recinf"))
                  ("rec-recsel" (search-input-file inputs "bin/recsel")))))))))
    (inputs
     (modify-inputs (package-inputs emacs-rec-mode)
       (prepend recutils)))))

(define %packages
  (list aerc
        alsa-utils
        bemenu
        ccls
        efibootmgr ;for recovery purposes
        emacs-next-pgtk
        endless-sky
        fd
        fish
        font-google-noto
        font-jetbrains-mono
        foot
        gdb
        git
        (list git "send-email")
        gnupg
        grim
        grub-efi ;for recovery purposes
        guile-3.0
        hut
        i3-autotiling
        imv
        janet
        libnotify
        mako
        man-pages
        man-pages-posix
        minetest
        mpv
        ncurses
        openssh
        openttd
        pamixer
        pinentry-qt
        python
        python-pygments
        qtwayland-5
        qutebrowser
        ripgrep
        sdl2 ;for openttd
        senpai
        slurp
        smartmontools
        supertuxkart
        swayidle
        telescope
        util-linux
        waybar
        wesnoth
        wireplumber
        wl-clipboard
        xdg-utils
        zathura
        zathura-pdf-mupdf
        zip
        zstd))

(define %emacs-packages
  (list emacs-corfu
        emacs-editorconfig
        emacs-eglot
        emacs-eglot-ccls
        emacs-evil
        emacs-evil-collection
        emacs-evil-surround
        emacs-fennel-mode
        emacs-gcmh
        emacs-geiser
        emacs-geiser-guile
        emacs-gemini-mode
        emacs-go-mode
        emacs-hare-mode
        emacs-janet-mode
        emacs-kotlin-mode
        emacs-lua-mode
        emacs-magit
        emacs-markdown-mode
        emacs-meson-mode
        emacs-moody
        emacs-paredit
        emacs-pinentry
        emacs-rainbow-delimiters
        emacs-realgud
        local/emacs-rec-mode
        emacs-smartparens
        emacs-tempel
        emacs-transpose-frame
        emacs-use-package
        emacs-zenburn-theme
        emacs-zoxide))

(define %env-vars
  '(("EDITOR"              . "emacsclient -c")
    ("VISUAL"              . "emacsclient -c")
    ("GPG_TTY"             . "(tty)")
    ("CC"                  . "gcc")
    ("QT_QPA_PLATFORM"     . "wayland")
    ("XDG_SESSION_TYPE"    . "wayland")
    ("XDG_SESSION_DESKTOP" . "sway")
    ("XDG_CURRENT_DESKTOP" . "sway")
    ("DESKTOP_SESSION"     . "sway")
    ("LIBSEAT_BACKEND"     . "seatd")))

(define %waybar-config
  (computed-file "waybar.json"
    #~(begin
       (use-modules (ice-9 format)
                    (ice-9 rdelim)
                    (ice-9 textual-ports)
                    (language tree-il))
       (primitive-load #$(config-file "common.scm"))
       (call-with-input-file #$(config-file "waybar.json")
         (lambda (in)
           (call-with-output-file #$output
             (lambda (out)
               (do ((line "" (read-line in)))
                   ((eof-object? line))
                 (when (not (string-prefix? "//" line))
                   (format out "~a~%" line))))))))))

(define %config-files
  `("aerc/aerc.conf"
    ("aerc-binds.conf" . "aerc/binds.conf")
    ("emacs-templates" . "emacs/templates")
    "fish/conf.d/hashrepo.fish"
    "fish/conf.d/vi-bindings.fish"
    "fish/conf.d/colourscheme.fish"
    "fish/conf.d/prompt.fish"
    "guix/channels.scm"
    "senpai/senpai.scfg"
    ("sway.conf" . "sway/config")
    (,%waybar-config . "waybar/config")
    ("waybar.css" . "waybar/style.css")))

(define %home-files
  (map normalize-config
       '(".gnupg/gpg.conf"
         ".gnupg/gpg-agent.conf"
         ("gitconfig" . ".gitconfig"))))

(define %services
  (list (service home-files-service-type %home-files)
        (service home-xdg-configuration-files-service-type
                 (map normalize-config
                      %config-files))
        (service home-bash-service-type
                 (home-bash-configuration
                  (bash-profile (list (config-file "bash_profile")))))
        (service home-fish-service-type
                 (home-fish-configuration
                  (environment-variables %env-vars)))
        (service home-dbus-service-type)
        (service home-emacs-service-type
                 (home-emacs-configuration
                  (emacs emacs-next-pgtk)
                  (packages
                   (map normalize-emacs-package
                        %emacs-packages))
                  (native-compile? #t)
                  (init-file (config-file "emacs.el"))
                  (early-init-file (config-file "emacs-early.el"))
                  (debug? #t)))
        (service home-mako-service-type
                 (home-mako-configuration
                  (sections
                   (list (home-mako-section
                          (on-notify
                           (list (file-append mpv "/bin/mpv")
                                 #~(string-append
                                    (or #$(getenv "XDG_CONFIG_HOME")
                                        (string-append #$(getenv "HOME")
                                                       "/.config"))
                                    "/mako/bell.mp3")
                                 "--volume=30")))
                         %home-mako-default-grouped-section))))
        ;(service home-pipewire-service-type)
        (service home-foot-service-type
                 (home-foot-configuration
                  (servers
                   (list (home-foot-server
                          (display "wayland-1")
                          (config-file (config-file "foot.ini")))))))
        (service home-batsignal-service-type
                 (home-batsignal-configuration
                  (danger-command (file-append shepherd "/sbin/halt"))
                  (notifications-expire? #t)))
        (service home-himitsu-service-type
                 (home-himitsu-configuration
                  (prompter-display "wayland-1")))
        (service home-himitsu-ssh-service-type)))

(home-environment
  (services %services)
  (packages (map normalize-package %packages)))