aboutsummaryrefslogtreecommitdiffstats
path: root/oni/home/config/pop-os.scm
blob: 8f01330a984400a963970810c2124e7e3da5a0cd (plain)
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
(define-module (oni home config pop-os)
  #:use-module (guix records)
  #:use-module (gnu home)
  #:use-module ((gnu home services gnupg)
                #:select (home-gpg-agent-service-type
                          home-gpg-agent-configuration))
  #:use-module (gnu packages)
  #:use-module (gnu packages emacs)
  #:use-module (gnu packages music)
  #:use-module (gnu packages pulseaudio)
  #:use-module ((gnu services)
		        #:select (service))
  #:use-module ((guix gexp)
		        #:select (local-file
			              mixed-text-file))
  #:use-module (oni home config common)
  #:use-module ((oni home services dunst)
                #:select (home-dunst-default-service))
  #:use-module (oni home services emacs)
  #:use-module ((oni home services environment)
		        #:select (home-environment-service))
  #:use-module ((oni home services flameshot)
                #:select (home-flameshot-service-type))
  #:use-module (oni home services git)
  #:use-module (oni home services herbstluftwm)
  #:use-module ((oni home services mail)
                #:select (home-mbsync-service-type))
  #:use-module (oni home services polybar)
  #:use-module (oni home services rofi)
  #:use-module (oni home services xdisorg)
  #:use-module (oni packages emacs)
  #:use-module (oni packages emacs-config)
  #:use-module ((oni packages fonts)
                #:select (font-comfortaa
                          font-annotation-mono))
  #:use-module (oni packages hlwm-run-or-raise)
  #:use-module (oni packages shutdown-rofi))

(define-record-type* <home-module> home-module
  make-home-environment
  home-module?
  (packages home-module-packages
            (default '()))
  (services home-module-services
            (default '())))

(define oni-home-herbstluftwm-configuration
  (home-module
   (packages (list hlwm-run-or-raise))
   (services (list
              (service home-herbstluftwm-service-type
                       (home-herbstluftwm-configuration
                        (tags '(dev web))
                        (key-bindings
                         '(("s-S-q" . "quit")
                           ("s-S-e" . "reload")))
                        (mouse-bindings
                         '(("s-Button1" . "move")
                           ("s-Button2" . "zoom")
                           ("s-Button3" . "resize")))
                        (settings
                         '((default_frame_layout . 2)
                           (frame_border_active_color . "#3d3d3d")
                           (frame_border_normal_color . "#222222")
                           (frame_bg_normal_color . "#111111")
                           (frame_bg_active_color . "#263f1f")
                           (frame_border_width . 0)
                           (window_border_width . 2)
                           (window_border_inner_width . 0)
                           (window_border_normal_color . "#222222")
                           (window_border_active_color . "#1f3f3f")
                           (window_border_inner_color . "#111111")
                           (always_show_frame . 0)
                           (frame_gap . 30)
                           (window_gap . 30)
                           (frame_padding . -30)
                           (frame_bg_transparent . 1)
                           (smart_window_surroundings . 0)
                           (smart_frame_surroundings . 0)
                           (mouse_recenter_gap . 0)
                           (swap_monitors_to_get_tag . 0)
                           (update_dragged_clients . 1)
                           (tree_style . "╾│ ├└╼─┐")))
                        (attributes
                         '(((theme tiling reset) . 1)
                           ((theme floating reset) . 1)))
                        (rules
                         '(("focus=on")
                           ("class=Emacs" "tag=dev" "index=01" "switchtag=on"
                            "hook=emacs")
                           ("class~'URxvt|kitty|wezterm'" "tag=dev" "index=1"
                            "switchtag=on" "hook=urxvt")
                           ("class~'Conkeror|[Ff]irefox|Chromium|glide-glide'" "tag=web"
                            "index=0" "switchtag=on")
                           ("class=Pinentry" "pseudotile=on")
                           ("class=Alsaplayer" "pseudotile=on")
                           ("class=Gcr-prompter" "pseudotile=on")
                           ("class=Steam" "title='Steam Login'" "pseudotile=on")
                           ("class=Steam" "title~'Steam - News .*'"
                            "pseudotile=on")
                           ("class=" "title=Steam" "pseudotile=on")
                           ("class=xfreerdp" "floating=on" "tag=work" "index=0"
                            "switchtag=on")
                           ("windowtype~'_NET_WM_WINDOW_TYPE_(DIALOG|UTILITY|SPLASH)'"
                            "pseudotile=on")
                           ("windowtype='_NET_WM_WINDOW_TYPE_DIALOG'" "focus=on")
                           ("windowtype~'_NET_WM_WINDOW_TYPE_(NOTIFICATION|DOCK|DESKTOP)'"
                            "manage=off")
                           ("class=pinball.exe" "pseudotile=on")))
                        (padding '(0 0 0 16 16))
                        (layouts
                         '((web clients max:0)
                           (dev split horizontal:0.7375:1 (clients max:0)
                                (clients vertical:0))))
                        (extra
                         (list
                          (mixed-text-file
                           "autostart"
                           "herbstclient focus_edge left\n"
                           "herbstclient keybind Mod4-apostrophe spawn dunstctl close\n"
                           "herbstclient keybind Mod4-quotedbl spawn dunstctl close-all\n"
                           "herbstclient keybind Mod4-Control-apostrophe spawn dunstctl history-pop\n"
                           "herbstclient keybind Mod4-Mod1-apostrophe spawn dunstctl context\n"
                           "herbstclient spawn pick-random-wallpaper\n")))))

              (service home-sxhkd-service-type
                       (home-sxhkd-configuration
                        (configurations
                         (list (local-file "sxhkdrc")
                               (mixed-text-file
                                "sxhkdrc-playerctl"
                                "XF86AudioPlay\n"
                                "    herbstclient spawn " playerctl
                                "/bin/playerctl play-pause\n"
                                "XF86AudioNext\n"
                                "    herbstclient spawn " playerctl
                                "/bin/playerctl next\n"
                                "XF86AudioPrev\n"
                                "    herbstclient spawn " playerctl
                                "/bin/playerctl prev\n")
                               (mixed-text-file
                                "sxhkdrc-pamixer"
                                "XF86AudioRaiseVolume\n"
                                "    herbstclient spawn " pamixer
                                "/bin/pamixer --increase 10\n"
                                "XF86AudioLowerVolume\n"
                                "    herbstclient spawn " pamixer
                                "/bin/pamixer --decrease 10\n"
                                "XF86AudioMute\n"
                                "    herbstclient spawn " pamixer
                                "/bin/pamixer --toggle-mute\n")))))

              (service home-polybar-service-type
                       (home-polybar-configuration
                        (bar "example")))))))

(define* (home-modules->home-environment #:rest modules)
  (home-environment
   (packages
    (apply append (map home-module-packages modules)))
   (services
    (apply append (map home-module-services modules)))))

(home-modules->home-environment
 oni-home-herbstluftwm-configuration
 (home-module
  (packages (append
             foreign-distro-compatibility-packages
             (map specification->package '("font-fantasque-sans"
                                           "font-dosis"
                                           "wezterm"
                                           "tree-sitter-vue"
                                           "tree-sitter-typescript"
                                           "emacs-popup"
                                           "emacs-git-messenger"
                                           "emacs-csv-mode"
                                           "htop"
                                           "emacs-deft"
                                           "emacs-dashboard"
                                           "emacs-typescript-mode"
                                           "hunspell"
                                           "hunspell-dict-en-ca"
                                           "emacs-dired-git-info"
                                           "playerctl"
                                           "pamixer"
                                           ;; need to have a file
                                           ;; /etc/udev/rules.d/40-monitor-hotplug.rules
                                           ;;    ACTION=="change", SUBSYSTEM=="drm", RUN+="/var/guix/profiles/per-user/tomwillemsen/guix-home/profile/bin/autorandr --batch --change --default default"
                                           "autorandr"
                                           "emacs-guix"
                                           "emacs-rainbow-identifiers"
                                           "emacs-forge"
                                           "emacs-vundo"
                                           "emacs-sops"
                                           "emacs-dockerfile-mode"
                                           "emacs-slack"
                                           "emacs-combobulate"))
		     (list emacs-oni-core
                   emacs-oni-compilation
                   emacs-oni-common-lisp
                   emacs-oni-browse-url
                   emacs-oni-package
                   emacs-oni-elisp
                   emacs-oni-gui
                   emacs-oni-magit
                   emacs-oni-diff-hl
                   emacs-oni-project
                   emacs-oni-dired
                   emacs-oni-log-edit
                   emacs-oni-git-commit
                   emacs-oni-scheme
                   emacs-oni-tramp
                   emacs-oni-bookmark
                   (emacs-oni-org emacs)
                   (emacs-oni-org-roam emacs)
                   emacs-oni-html
                   emacs-oni-grep
                   emacs-oni-shr
                   emacs-oni-css
                   emacs-oni-yaml
                   ;; emacs-oni-web-mode
                   emacs-oni-php
                   emacs-oni-projectile
                   emacs-oni-lua
                   emacs-oni-sh
                   emacs-oni-js
                   emacs-oni-elfeed
                   emacs-oni-eshell
                   emacs-oni-outline
                   emacs-oni-sql

                   emacs-flycheck-phpstan
                   emacs-vue-ts-mode

                   shutdown-rofi)))
  (services (append
             home-zsh-services
             (list home-channels-service
                   home-dunst-default-service
		           home-environment-service
		           home-rofi-default-service

                   (service home-emacs-service-type
		                    (home-emacs-configuration
                             (helpful-configuration
                              (home-emacs-helpful-configuration
                               (configurations
                                (list
                                 (local-file "../services/emacs/oni-helpful.el")))))
                             (yasnippet-capf
                              (home-emacs-yasnippet-capf-configuration))
                             (envrc
                              (home-emacs-envrc-configuration))
		                     (configurations
		                      (list
		                       (local-file "../services/emacs/init.el")
                               (local-file "pop-os/emacs.el")
		                       (mixed-text-file
		                        "init.el"
		                        "(with-eval-after-load 'project (require 'oni-project))\n"
                                "(require 'oni-gui)\n"
                                "(provide 'oni-gnus)\n"
                                ;; "(add-to-list 'auto-mode-alist '(\"\\.vue$\" . web-mode))\n"
                                )))))
                   (service home-emacs-org-journal-service-type)
		           (service home-wakatime-service-type
		                    (home-wakatime-configuration
		                     (api-url "https://waka.ryuslash.org/api")
		                     (exclude '("^COMMIT_EDITMSG$"
		    	                        "^TAG_EDITMSG$"))))
                   (service home-emacs-vterm-service-type
                            (home-emacs-vterm-configuration
                             (buffer-name-string "*vterm* %s")))

                   (service home-flameshot-service-type)
                   (service home-mbsync-service-type)

                   (service home-gpg-agent-service-type
                            (home-gpg-agent-configuration
                             (ssh-support? #t)
                             (extra-content
                              "allow-emacs-pinentry\n")))

                   (service home-git-service-type
                            (home-git-configuration
                             (user-name "Tom Willemse")
                             (user-email "tom@ryuslash.org")
                             (sendemail-sendmailcmd "/usr/bin/msmtp")
                             (init-default-branch "main")
                             (init-default-branchname "main")
                             (advice-detached-head #f)
                             (extra "
[diff \"org\"]
    xfuncname = \"^\\\\*+ +(.+)\"
[diff \"lisp\"]
    xfuncname = \"^[[:space:]]*?\\\\(def\\\\w+? ((\\\\w|-|'|:|=|<|>)+)\"
")
                             (ignore-patterns '("GPATH" "GTAGS" "GRTAGS"))))

                   (service home-emacs-org-mem-service-type))))))