diff options
Diffstat (limited to 'src/jd')
-rw-r--r-- | src/jd/config.scm | 23 | ||||
-rw-r--r-- | src/jd/features/mail.scm | 115 | ||||
-rw-r--r-- | src/jd/features/networking.scm | 81 | ||||
-rw-r--r-- | src/jd/host.scm | 47 | ||||
-rw-r--r-- | src/jd/user.scm | 507 |
5 files changed, 773 insertions, 0 deletions
diff --git a/src/jd/config.scm b/src/jd/config.scm new file mode 100644 index 0000000..f79df44 --- /dev/null +++ b/src/jd/config.scm | |||
@@ -0,0 +1,23 @@ | |||
1 | (define-module (jd config) | ||
2 | #:use-module (jd host) | ||
3 | #:use-module (jd user) | ||
4 | #:use-module (rde features) | ||
5 | #:use-module (gnu services) | ||
6 | #:use-module (gnu system) | ||
7 | #:use-module (gnu services guix) | ||
8 | #:use-module (srfi srfi-1) | ||
9 | #:use-module (ice-9 match)) | ||
10 | |||
11 | |||
12 | (define-public jd-config | ||
13 | (rde-config | ||
14 | (integrate-he-in-os? #t) | ||
15 | (features | ||
16 | (append | ||
17 | (list (feature-nonfree-kernel)) | ||
18 | %host-features | ||
19 | %user-features)))) | ||
20 | |||
21 | (define-public %os | ||
22 | (rde-config-operating-system jd-config)) | ||
23 | |||
diff --git a/src/jd/features/mail.scm b/src/jd/features/mail.scm new file mode 100644 index 0000000..f5c3536 --- /dev/null +++ b/src/jd/features/mail.scm | |||
@@ -0,0 +1,115 @@ | |||
1 | (define-module (jd features mail) | ||
2 | #:use-module (rde packages) | ||
3 | #:use-module (rde exceptions) | ||
4 | #:use-module (rde features) | ||
5 | #:use-module (rde predicates) | ||
6 | #:use-module (rde features emacs) | ||
7 | #:use-module (rde features mail) | ||
8 | #:use-module ((rde features mail providers) #:prefix mail-providers:) | ||
9 | #:use-module (gnu packages mail) | ||
10 | #:use-module (gnu packages emacs-xyz) | ||
11 | #:use-module (rde packages emacs-xyz) | ||
12 | #:use-module (rde packages mail) | ||
13 | #:use-module (rde serializers elisp) | ||
14 | #:use-module (rde home services mail) | ||
15 | #:use-module (gnu services) | ||
16 | #:use-module (gnu services configuration) | ||
17 | #:use-module (gnu home services) | ||
18 | #:use-module (gnu home-services mail) | ||
19 | #:use-module (gnu home services mcron) | ||
20 | #:use-module (gnu home-services version-control) | ||
21 | #:use-module (gnu home services xdg) | ||
22 | |||
23 | #:use-module (ice-9 match) | ||
24 | #:use-module (srfi srfi-1) | ||
25 | #:use-module (guix gexp) | ||
26 | #:use-module (guix deprecation) | ||
27 | #:use-module (guix diagnostics) | ||
28 | #:use-module (guix i18n) | ||
29 | |||
30 | #:export (feature-l2md* feature-mail-mcron)) | ||
31 | |||
32 | (define* (feature-l2md* | ||
33 | #:key | ||
34 | (l2md l2md)) | ||
35 | "Configure l2md MDA." | ||
36 | (ensure-pred file-like? l2md) | ||
37 | |||
38 | (define (get-home-services config) | ||
39 | (require-value 'mail-directory-fn config) | ||
40 | (require-value 'mailing-lists config) | ||
41 | (define mail-dir ((get-value 'mail-directory-fn config) config)) | ||
42 | (define mls (filter (lambda (x) (eq? (mailing-list-synchronizer x) 'l2md)) | ||
43 | (get-value 'mailing-lists config))) | ||
44 | (define (get-repo-config ml) | ||
45 | (let ((repo-config (mailing-list-config ml))) | ||
46 | (if (eq? %unset-value (l2md-repo-maildir repo-config)) | ||
47 | (l2md-repo | ||
48 | (inherit repo-config) | ||
49 | (maildir (string-append | ||
50 | mail-dir "/lists/" (mailing-list-fqda ml) "/archive"))) | ||
51 | repo-config))) | ||
52 | ;; <https://git.kernel.org/pub/scm/linux/kernel/git/dborkman/l2md.git/about/> | ||
53 | ;; Applying patches <https://git.kyleam.com/piem/about/> | ||
54 | |||
55 | (define add-ml-tag | ||
56 | (map (lambda (x) | ||
57 | (format | ||
58 | #f "notmuch tag +~a -- path:lists/~a/**" | ||
59 | ;; TODO: Use new tag not to retag already existing entities. | ||
60 | ;; Do it before new tag will be romved | ||
61 | ;; TODO: Fix order of items in post-new hook | ||
62 | (mailing-list-id x) (mailing-list-fqda x))) | ||
63 | mls)) | ||
64 | |||
65 | (list | ||
66 | (simple-service | ||
67 | 'l2md-add-tags-to-mailing-list | ||
68 | home-notmuch-service-type | ||
69 | (home-notmuch-extension | ||
70 | (post-new | ||
71 | (list | ||
72 | #~(begin (for-each system '#$add-ml-tag)))))) | ||
73 | |||
74 | (service | ||
75 | home-l2md-service-type | ||
76 | (home-l2md-configuration | ||
77 | (l2md l2md) | ||
78 | (oneshot 1) | ||
79 | (repos (map get-repo-config mls)))))) | ||
80 | |||
81 | (feature | ||
82 | (name 'l2md) | ||
83 | (home-services-getter get-home-services) | ||
84 | (values `((l2md . ,l2md))))) | ||
85 | |||
86 | (define* (feature-mail-mcron | ||
87 | #:key | ||
88 | (time-spec '(next-minute | ||
89 | (range 0 60 20)))) | ||
90 | "Configure mcron to invoke other email commands based on the other | ||
91 | features that have been enabled." | ||
92 | (define (get-home-services config) | ||
93 | (list | ||
94 | (when (get-value 'isync config) | ||
95 | (let* ((sync-cmd (list `(,((get-value 'mbsync config) config) "-a"))) | ||
96 | (notmuch-cmd (if (get-value 'notmuch config) | ||
97 | (list `(,(file-append (get-value 'notmuch config) "/bin/notmuch") | ||
98 | "new")) | ||
99 | (list))) | ||
100 | (l2md-cmd (if (get-value 'l2md config) | ||
101 | (list `(,(file-append (get-value 'l2md config) "/bin/l2md"))) | ||
102 | (list)))) | ||
103 | (simple-service | ||
104 | 'isync-mcron-job | ||
105 | home-mcron-service-type | ||
106 | (list | ||
107 | #~(job '#$time-spec | ||
108 | (lambda () | ||
109 | (setenv "DISPLAY" ":0") | ||
110 | #$@(map (lambda (x) `(system* ,@x)) | ||
111 | (append sync-cmd l2md-cmd notmuch-cmd)))))))))) | ||
112 | |||
113 | (feature | ||
114 | (name 'mail-mcron) | ||
115 | (home-services-getter get-home-services))) | ||
diff --git a/src/jd/features/networking.scm b/src/jd/features/networking.scm new file mode 100644 index 0000000..59eeb90 --- /dev/null +++ b/src/jd/features/networking.scm | |||
@@ -0,0 +1,81 @@ | |||
1 | (define-module (jd features networking) | ||
2 | #:use-module (rde features) | ||
3 | #:use-module (rde predicates) | ||
4 | |||
5 | #:use-module (gnu services) | ||
6 | #:use-module (gnu home services) | ||
7 | #:use-module (gnu home services shepherd) | ||
8 | #:use-module (rde home services i2p) | ||
9 | #:use-module (gnu services networking) | ||
10 | #:use-module (gnu system nss) | ||
11 | ;; #:use-module (rde system services networking) | ||
12 | #:use-module (rde system services accounts) | ||
13 | |||
14 | #:use-module (gnu packages i2p) | ||
15 | #:use-module (gnu packages networking) | ||
16 | #:use-module (gnu packages ssh) | ||
17 | #:use-module (gnu packages gnome) | ||
18 | #:use-module (rde packages) | ||
19 | |||
20 | #:use-module (guix gexp) | ||
21 | |||
22 | #:export (feature-networking*)) | ||
23 | |||
24 | (define* (feature-networking* | ||
25 | #:key | ||
26 | (iwd-autoconnect? #t) | ||
27 | (network-manager network-manager) | ||
28 | (network-manager-applet network-manager-applet) | ||
29 | (network-manager-vpn-plugins '()) | ||
30 | mdns?) | ||
31 | "Configure iwd and everything." | ||
32 | (ensure-pred file-like? network-manager) | ||
33 | (ensure-pred file-like? network-manager-applet) | ||
34 | |||
35 | (define f-name 'networking) | ||
36 | (define (get-home-services config) | ||
37 | |||
38 | (list | ||
39 | (simple-service 'network-manager-applet-package | ||
40 | home-profile-service-type | ||
41 | (list network-manager-applet)) | ||
42 | ;; TODO: Disable nm-applet notification by default | ||
43 | ;; gsettings set org.gnome.nm-applet disable-connected-notifications true | ||
44 | (simple-service | ||
45 | 'networking-nm-applet-shepherd-service | ||
46 | home-shepherd-service-type | ||
47 | (list | ||
48 | (shepherd-service | ||
49 | (provision '(nm-applet)) | ||
50 | (requirement '(dbus)) | ||
51 | (stop #~(make-kill-destructor)) | ||
52 | (start #~(make-forkexec-constructor | ||
53 | (list #$(file-append network-manager-applet "/bin/nm-applet") | ||
54 | "--indicator") | ||
55 | #:log-file (string-append | ||
56 | (getenv "XDG_STATE_HOME") "/log" | ||
57 | "/nm-applet.log")))))))) | ||
58 | |||
59 | (define (get-system-services config) | ||
60 | (list | ||
61 | (service network-manager-service-type | ||
62 | (network-manager-configuration | ||
63 | (network-manager network-manager) | ||
64 | (vpn-plugins network-manager-vpn-plugins) | ||
65 | (shepherd-requirement '(iwd)))) | ||
66 | (service (@@ (rde system services networking) iwd-service-type) | ||
67 | ((@@ (rde system services networking) iwd-configuration) | ||
68 | (main-conf | ||
69 | `((Settings ((AutoConnect . ,iwd-autoconnect?))))))) | ||
70 | (service modem-manager-service-type) | ||
71 | (service usb-modeswitch-service-type))) | ||
72 | |||
73 | (feature | ||
74 | (name f-name) | ||
75 | (values `((,f-name . #t) | ||
76 | ,@(if mdns? | ||
77 | `((name-service . ,%mdns-host-lookup-nss) | ||
78 | (mdns . #t)) | ||
79 | '()))) | ||
80 | (home-services-getter get-home-services) | ||
81 | (system-services-getter get-system-services))) | ||
diff --git a/src/jd/host.scm b/src/jd/host.scm new file mode 100644 index 0000000..7071a3f --- /dev/null +++ b/src/jd/host.scm | |||
@@ -0,0 +1,47 @@ | |||
1 | (define-module (jd host) | ||
2 | #:use-module (rde features base) | ||
3 | #:use-module (rde features system) | ||
4 | #:use-module (rde features wm) | ||
5 | #:use-module (gnu system file-systems) | ||
6 | #:use-module (gnu system mapped-devices) | ||
7 | #:use-module (ice-9 match)) | ||
8 | |||
9 | (define-public %host-features | ||
10 | (list | ||
11 | (feature-host-info | ||
12 | #:host-name "berserker" | ||
13 | #:timezone "Europe/Warsaw") | ||
14 | (feature-file-systems | ||
15 | #:mapped-devices (list (mapped-device | ||
16 | (source (uuid | ||
17 | "1f2b1bf2-89fe-4e2c-8b40-c460572bb776")) | ||
18 | (target "crypthome") | ||
19 | (type luks-device-mapping))) | ||
20 | #:file-systems (list | ||
21 | (file-system | ||
22 | (mount-point "/") | ||
23 | (device (uuid | ||
24 | "c895e61e-1a5e-470f-b7aa-a502fc0b8596" | ||
25 | 'ext4)) | ||
26 | (type "ext4")) | ||
27 | (file-system | ||
28 | (mount-point "/boot/efi") | ||
29 | (device (uuid "9669-0171" | ||
30 | 'fat32)) | ||
31 | (type "vfat")) | ||
32 | (file-system | ||
33 | (mount-point "/home") | ||
34 | (device "/dev/mapper/crypthome") | ||
35 | (type "ext4") | ||
36 | (dependencies | ||
37 | (list (mapped-device | ||
38 | (source (uuid | ||
39 | "1f2b1bf2-89fe-4e2c-8b40-c460572bb776")) | ||
40 | (target "crypthome") | ||
41 | (type luks-device-mapping))))))) | ||
42 | (feature-kanshi | ||
43 | #:extra-config | ||
44 | `((profile laptop ((output eDP-1 enable))) | ||
45 | (profile docked ((output eDP-1 disable) | ||
46 | (output DP-3 enable))))) | ||
47 | (feature-hidpi))) | ||
diff --git a/src/jd/user.scm b/src/jd/user.scm new file mode 100644 index 0000000..7c54a30 --- /dev/null +++ b/src/jd/user.scm | |||
@@ -0,0 +1,507 @@ | |||
1 | (define-module (jd user) | ||
2 | #:use-module (gnu home services) | ||
3 | #:use-module (gnu home services shepherd) | ||
4 | #:use-module (gnu home-services ssh) | ||
5 | #:use-module (gnu home services xdg) | ||
6 | #:use-module (gnu packages) | ||
7 | #:use-module (gnu packages emacs-xyz) | ||
8 | #:use-module (gnu packages gnome) | ||
9 | #:use-module (gnu packages gnupg) | ||
10 | #:use-module (gnu packages guile-xyz) | ||
11 | #:use-module (gnu services) | ||
12 | #:use-module (gnu services nix) | ||
13 | |||
14 | #:use-module (guix channels) | ||
15 | #:use-module (guix download) | ||
16 | #:use-module (guix gexp) | ||
17 | #:use-module (guix inferior) | ||
18 | #:use-module (guix packages) | ||
19 | |||
20 | #:use-module (jd features mail) | ||
21 | #:use-module (jd features networking) | ||
22 | |||
23 | #:use-module (nongnu packages linux) | ||
24 | #:use-module (nongnu system linux-initrd) | ||
25 | |||
26 | #:use-module (rde features) | ||
27 | #:use-module (rde packages) | ||
28 | #:use-module (rde packages aspell) | ||
29 | |||
30 | #:use-module (srfi srfi-1)) | ||
31 | |||
32 | |||
33 | (define-syntax-rule (use-rde-features-modules module ...) | ||
34 | (use-modules (rde features module) ...)) | ||
35 | |||
36 | (define-syntax-rule (use-rde-home-services-modules module ...) | ||
37 | (use-modules (rde features module) ...)) | ||
38 | |||
39 | (use-rde-features-modules | ||
40 | android base bittorrent clojure containers | ||
41 | documentation emacs emacs-xyz finance fontutils | ||
42 | gnupg gtk guile image-viewers irc keyboard | ||
43 | libreoffice linux llm mail markup networking ocaml | ||
44 | password-utils presets security-token shells | ||
45 | shellutils sourcehut ssh system terminals tmux uml | ||
46 | version-control video virtualization web-browsers wm xdg python) | ||
47 | |||
48 | (use-rde-home-services-modules | ||
49 | emacs shells video wm) | ||
50 | |||
51 | (define* (mail-acc id user #:optional (type 'migadu)) | ||
52 | "Make a simple mail-account with gmail type by default." | ||
53 | (mail-account | ||
54 | (id id) | ||
55 | (fqda user) | ||
56 | (type type))) | ||
57 | |||
58 | (define* (mail-lst id fqda urls) | ||
59 | "Make a simple mailing-list." | ||
60 | (mailing-list | ||
61 | (id id) | ||
62 | (fqda fqda) | ||
63 | (config (l2md-repo | ||
64 | (name (symbol->string id)) | ||
65 | (urls urls))))) | ||
66 | |||
67 | (define-public %base-features | ||
68 | (list | ||
69 | (feature-backlight #:step 10) | ||
70 | (feature-networking* #:network-manager-vpn-plugins (list network-manager-openvpn) | ||
71 | #:mdns? #t) | ||
72 | (feature-base-services) | ||
73 | (feature-base-packages) | ||
74 | (feature-desktop-services) | ||
75 | (feature-xdg | ||
76 | #:xdg-user-directories-configuration | ||
77 | (home-xdg-user-directories-configuration | ||
78 | (music "$HOME/music") | ||
79 | (videos "$HOME/videos") | ||
80 | (pictures "$HOME/pictures") | ||
81 | (documents "$HOME/documents") | ||
82 | (download "$HOME/downloads") | ||
83 | (publicshare "$HOME/sync") | ||
84 | (desktop "$HOME") | ||
85 | (templates "$HOME"))) | ||
86 | (feature-pipewire) | ||
87 | (feature-shepherd))) | ||
88 | |||
89 | (define-public %desktop-features | ||
90 | (list | ||
91 | (feature-sway-run-on-tty #:sway-tty-number 2) | ||
92 | (feature-gtk3 #:gtk-theme (make-theme "Adwaita-dark" gnome-themes-extra)) | ||
93 | (feature-fonts #:default-font-size 14) | ||
94 | (feature-transmission #:auto-start? #f) | ||
95 | (feature-sway | ||
96 | #:extra-config | ||
97 | '((input type:touchpad | ||
98 | ((tap enabled) | ||
99 | (middle_emulation enabled))) | ||
100 | (workspace_layout tabbed) | ||
101 | (bindsym $mod+q layout tabbed) | ||
102 | (bindsym $mod+a layout stacking) | ||
103 | (bindsym $mod+z layout toggle split) | ||
104 | (default_border none) | ||
105 | (default_floating_border pixel 3) | ||
106 | ;; (default_border normal 3) | ||
107 | ;; (default_floating_border normal 3) | ||
108 | ;; (gaps inner 0) | ||
109 | (output * bg "#181818" solid_color) | ||
110 | (client.focused "#181818" "#383838" "#d8d8d8" "#7cafc2") | ||
111 | (client.focused_inactive "#181818" "#282828" "#b8b8b8" "#7cafc2") | ||
112 | (client.unfocused "#181818" "#282828" "#b8b8b8" "#7cafc2") | ||
113 | (client.urgent "#181818" "#ab4642" "#f8f8f8" "#181818") | ||
114 | (bindsym $mod+h focus left) | ||
115 | (bindsym $mod+j focus down) | ||
116 | (bindsym $mod+k focus up) | ||
117 | (bindsym $mod+l focus right) | ||
118 | |||
119 | (unbindsym --to-code $mod+Shift+l) | ||
120 | (bindsym --to-code $mod+Escape exec $lock) | ||
121 | |||
122 | (bindsym $mod+Shift+h move left) | ||
123 | (bindsym $mod+Shift+j move down) | ||
124 | (bindsym $mod+Shift+k move up) | ||
125 | (bindsym $mod+Shift+l move right))) | ||
126 | (feature-waybar | ||
127 | ;; #:base16-css base16-solarized-dark | ||
128 | #:waybar-modules | ||
129 | (list | ||
130 | (waybar-sway-workspaces | ||
131 | #:format-icons | ||
132 | `(,@(map | ||
133 | (lambda (x) (cons | ||
134 | (number->string x) | ||
135 | (number->string x))) | ||
136 | (iota 10 1)) | ||
137 | ("urgent" . ) | ||
138 | ("default" . ))) | ||
139 | (waybar-idle-inhibitor) | ||
140 | (waybar-temperature) | ||
141 | (waybar-cpu) | ||
142 | (waybar-battery #:intense? #f) | ||
143 | (waybar-tray) | ||
144 | (waybar-clock))) | ||
145 | (feature-foot) | ||
146 | (feature-yt-dlp) | ||
147 | (feature-libreoffice) | ||
148 | (feature-emacs-power-menu) | ||
149 | (feature-sway-screenshot) | ||
150 | (feature-swaynotificationcenter) | ||
151 | (feature-swayidle) | ||
152 | (feature-swaylock) | ||
153 | (feature-batsignal) | ||
154 | (feature-imv) | ||
155 | (feature-mpv) | ||
156 | (feature-librewolf) | ||
157 | (feature-ledger))) | ||
158 | |||
159 | (define-public %mail-features | ||
160 | (list | ||
161 | (feature-isync #:isync-verbose #t) | ||
162 | (feature-mail-mcron) | ||
163 | (feature-l2md*) | ||
164 | (feature-msmtp))) | ||
165 | |||
166 | (define-public %cli-features | ||
167 | (list | ||
168 | (feature-zsh #:enable-zsh-autosuggestions? #t) | ||
169 | (feature-git #:extra-config '((gpg ((program . "gpg"))))) | ||
170 | (feature-manpages) | ||
171 | (feature-vterm) | ||
172 | (feature-bash) | ||
173 | (feature-direnv) | ||
174 | (feature-guile) | ||
175 | (feature-ssh))) | ||
176 | |||
177 | (define* (feature-emacs-personal-config) | ||
178 | (define f-name 'personal-emacs-config) | ||
179 | |||
180 | (define (get-home-services config) | ||
181 | (list | ||
182 | (rde-elisp-configuration-service | ||
183 | f-name | ||
184 | config | ||
185 | `((with-eval-after-load 'geiser-mode | ||
186 | (defun jd/guix-repl () | ||
187 | (interactive) | ||
188 | (let ((geiser-guile-binary '("guix" "repl")) | ||
189 | (geiser-guile-load-path (cons "~/dotfiles/rde" geiser-guile-load-path))) | ||
190 | (geiser 'guile)))) | ||
191 | |||
192 | (with-eval-after-load 'notmuch | ||
193 | (setq-default notmuch-search-oldest-first nil)) | ||
194 | |||
195 | (with-eval-after-load 'paredit | ||
196 | (defun jd/paredit-RET () | ||
197 | "Wraps `paredit-RET' to provide a sensible minibuffer experience" | ||
198 | (interactive) | ||
199 | (cond | ||
200 | ((minibufferp) | ||
201 | (read--expression-try-read)) | ||
202 | ((and (eq major-mode 'inferior-emacs-lisp-mode) | ||
203 | (string-prefix-p "*ielm*" (buffer-name))) | ||
204 | (ielm-return)) | ||
205 | (t | ||
206 | (paredit-RET)))) | ||
207 | (bind-key "<return>" 'jd/paredit-RET paredit-mode-map) | ||
208 | |||
209 | (dolist (hook '(emacs-lisp-mode-hook | ||
210 | eval-expression-minibuffer-setup-hook | ||
211 | ielm-mode-hook | ||
212 | lisp-mode-hook | ||
213 | lisp-interaction-mode-hook | ||
214 | scheme-mode-hook | ||
215 | clojure-mode-hook)) | ||
216 | (add-hook hook 'paredit-mode))) | ||
217 | |||
218 | (with-eval-after-load 'rainbow-delimiters | ||
219 | (dolist (hook '(emacs-lisp-mode-hook | ||
220 | eval-expression-minibuffer-setup-hook | ||
221 | ielm-mode-hook | ||
222 | lisp-mode-hook | ||
223 | lisp-interaction-mode-hook | ||
224 | scheme-mode-hook | ||
225 | clojure-mode-hook)) | ||
226 | (add-hook hook 'rainbow-delimiters-mode))) | ||
227 | |||
228 | (with-eval-after-load 'undo-tree | ||
229 | (setq-default undo-tree-auto-save-history nil) | ||
230 | (global-undo-tree-mode 1)) | ||
231 | |||
232 | (with-eval-after-load 'multiple-cursors | ||
233 | (setq-default mc/always-run-for-all t) | ||
234 | (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) | ||
235 | (global-set-key (kbd "C->") 'mc/mark-next-like-this) | ||
236 | (global-set-key (kbd "C-<") 'mc/mark-previous-like-this) | ||
237 | (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)) | ||
238 | |||
239 | (with-eval-after-load 'page-break-lines | ||
240 | (global-page-break-lines-mode 1)) | ||
241 | |||
242 | (with-eval-after-load 'gptel | ||
243 | (setq gptel-model 'gpt-4o | ||
244 | gptel-backend (gptel-make-gh-copilot "Copilot"))) | ||
245 | |||
246 | (with-eval-after-load 'simple | ||
247 | (add-hook 'after-init-hook (lambda () | ||
248 | (delete-selection-mode 1) | ||
249 | (pixel-scroll-precision-mode 0) | ||
250 | (electric-pair-mode 1) | ||
251 | (setq-default truncate-lines t) | ||
252 | (setq-default cursor-in-non-selected-windows 'hollow) | ||
253 | (setq-default cursor-type 'box) | ||
254 | ;; (set-face-attribute 'default nil :height 165) | ||
255 | ;; (require 'solarized-theme) | ||
256 | (require 'multiple-cursors) | ||
257 | (require 'undo-tree) | ||
258 | (require 'rainbow-delimiters) | ||
259 | (require 'paredit) | ||
260 | )) | ||
261 | (set-default 'display-fill-column-indicator-column 100) | ||
262 | (add-hook 'prog-mode-hook 'display-fill-column-indicator-mode) | ||
263 | (setq display-line-numbers-type 'relative) | ||
264 | (add-hook 'prog-mode-hook 'display-line-numbers-mode))) | ||
265 | #:elisp-packages | ||
266 | (strings->packages | ||
267 | "emacs-rainbow-mode" | ||
268 | "emacs-rainbow-delimiters" | ||
269 | "emacs-paredit" | ||
270 | "emacs-hl-todo" | ||
271 | "emacs-undo-tree" | ||
272 | "emacs-multiple-cursors" | ||
273 | ;; "emacs-swiper" | ||
274 | ;; "emacs-solarized-theme" | ||
275 | "emacs-nginx-mode" | ||
276 | "emacs-yaml-mode" | ||
277 | "emacs-org-present")))) | ||
278 | (feature | ||
279 | (name f-name) | ||
280 | (values `((,f-name . #t))) | ||
281 | (home-services-getter get-home-services))) | ||
282 | |||
283 | (define-public %emacs-features | ||
284 | (list | ||
285 | (feature-emacs-modus-themes #:headings-scaling? #t | ||
286 | #:deuteranopia? #f) | ||
287 | (feature-emacs-citation #:global-bibliography (list "/home/jakub/Notes/Roam/references/master.bib")) | ||
288 | (feature-emacs-completion #:mini-frame? #f ;; Dziwne kurwa bledy | ||
289 | #:marginalia-align 'right) | ||
290 | (feature-emacs-corfu #:corfu-doc-auto #f) | ||
291 | (feature-emacs #:default-application-launcher? #t) | ||
292 | (feature-emacs-elfeed #:elfeed-org-files '("/home/jakub/Notes/Rss.org")) | ||
293 | (feature-emacs-erc #:erc-log? #t | ||
294 | #:erc-autojoin-channels-alist '((Libera.Chat "#rde") | ||
295 | (Libera.Chat "#systemcrafters") | ||
296 | (Libera.Chat "#lisp-pl") | ||
297 | (Libera.Chat "#hsp"))) | ||
298 | (feature-emacs-keycast #:turn-on? #f) | ||
299 | (feature-emacs-org-agenda #:org-agenda-files '("/home/jakub/Notes/Me.org" "/home/jakub/Notes/Work.org")) | ||
300 | (feature-emacs-org-dailies #:encrypted? #t) | ||
301 | (feature-emacs-org #:org-directory "/home/jakub/Notes" | ||
302 | #:org-indent? #f) | ||
303 | (feature-emacs-org-roam #:org-roam-directory "/home/jakub/Notes/Roam/slip-box") | ||
304 | (feature-emacs-spelling #:spelling-program (@ (gnu packages hunspell) hunspell) | ||
305 | #:spelling-dictionaries (list (@ (gnu packages hunspell) hunspell-dict-en) | ||
306 | (@ (gnu packages hunspell) hunspell-dict-pl)) | ||
307 | #:ispell-standard-dictionary "pl_PL") | ||
308 | (feature-emacs-dired #:extra-switches "-h") | ||
309 | (feature-emacs-appearance) | ||
310 | (feature-emacs-dashboard) | ||
311 | (feature-emacs-eglot) | ||
312 | (feature-emacs-eshell) | ||
313 | (feature-emacs-git) | ||
314 | (feature-emacs-gptel) | ||
315 | (feature-emacs-guix) | ||
316 | (feature-emacs-message) | ||
317 | (feature-emacs-monocle) | ||
318 | (feature-emacs-nov-el) | ||
319 | (feature-emacs-pdf-tools) | ||
320 | (feature-emacs-personal-config) | ||
321 | (feature-emacs-project) | ||
322 | (feature-emacs-time) | ||
323 | (feature-emacs-tramp) | ||
324 | (feature-emacs-vertico) | ||
325 | (feature-emacs-webpaste) | ||
326 | (feature-emacs-which-key) | ||
327 | (feature-emacs-battery) | ||
328 | (feature-notmuch) | ||
329 | (feature-plantuml) | ||
330 | (feature-compile))) | ||
331 | |||
332 | (define %dev-features | ||
333 | (list | ||
334 | (feature-android) | ||
335 | (feature-clojure) | ||
336 | (feature-markdown) | ||
337 | (feature-python))) | ||
338 | |||
339 | (define %virtualization-features | ||
340 | (list | ||
341 | (feature-distrobox) | ||
342 | (feature-podman) | ||
343 | (feature-qemu))) | ||
344 | |||
345 | (define (feature-ssh-extra-config) | ||
346 | (feature-custom-services | ||
347 | #:feature-name-prefix 'jd-ssh-extra-config | ||
348 | #:home-services | ||
349 | (list | ||
350 | (simple-service | ||
351 | 'ssh-extra-config | ||
352 | home-ssh-service-type | ||
353 | (home-ssh-extension | ||
354 | (extra-config | ||
355 | (append | ||
356 | (list | ||
357 | (ssh-host | ||
358 | (host "jdlugosz.com") | ||
359 | (options | ||
360 | '((user . "root") | ||
361 | (port . 22) | ||
362 | (compression . #t)))) | ||
363 | (ssh-host | ||
364 | (host "amg.abaks.pl") | ||
365 | (options | ||
366 | '((user . "serwis") | ||
367 | (port . 22) | ||
368 | (compression . #t)))) | ||
369 | (ssh-host | ||
370 | (host "wifi-dev.abaks.pl") | ||
371 | (options | ||
372 | '((user . "serwis") | ||
373 | (port . 22) | ||
374 | (compression . #t))))))) | ||
375 | (toplevel-options | ||
376 | '((host-key-algorithms . "+ssh-rsa") | ||
377 | (pubkey-accepted-key-types . "+ssh-rsa")))))))) | ||
378 | |||
379 | (define (feature-additional-services) | ||
380 | (feature-custom-services | ||
381 | #:feature-name-prefix 'jd-additional-services | ||
382 | #:system-services | ||
383 | (list (service nix-service-type)) | ||
384 | #:home-services | ||
385 | (list | ||
386 | (simple-service | ||
387 | 'home-environment-extra-variables | ||
388 | home-environment-variables-service-type | ||
389 | '(("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"))) | ||
390 | ;; (simple-service | ||
391 | ;; 'home-nextcloud-package | ||
392 | ;; home-profile-service-type | ||
393 | ;; (list | ||
394 | ;; (@@ (gnu packages sync) nextcloud-client))) | ||
395 | (simple-service | ||
396 | 'nextcloud-shepherd-service | ||
397 | home-shepherd-service-type | ||
398 | (list | ||
399 | (shepherd-service | ||
400 | (provision `(nextcloud)) | ||
401 | (auto-start? #t) | ||
402 | (stop #~(make-kill-destructor)) | ||
403 | (start #~(make-forkexec-constructor | ||
404 | (list #$(program-file | ||
405 | "nextcloud" | ||
406 | #~(begin | ||
407 | (setenv "QT_QPA_PLATFORM" "wayland-egl;xcb") | ||
408 | (apply system* | ||
409 | (list | ||
410 | #$(file-append (@ (gnu packages sync) nextcloud-client) "/bin/nextcloud"))))))))))) | ||
411 | ;; (simple-service | ||
412 | ;; 'home-nextcloud-daemon) | ||
413 | (simple-service | ||
414 | 'home-profile-extra-packages | ||
415 | home-profile-service-type | ||
416 | (append | ||
417 | (list | ||
418 | (@ (gnu packages tree-sitter) tree-sitter-clojure) | ||
419 | (@ (gnu packages tree-sitter) tree-sitter-html)) | ||
420 | (strings->packages | ||
421 | "figlet" | ||
422 | "calibre" | ||
423 | |||
424 | "libnotify" | ||
425 | |||
426 | "flatpak" | ||
427 | |||
428 | "alsa-utils" | ||
429 | "pavucontrol" | ||
430 | "imagemagick" | ||
431 | "obs" "obs-wlrobs" | ||
432 | "binutils" "make" "gdb" | ||
433 | |||
434 | "hicolor-icon-theme" "adwaita-icon-theme" | ||
435 | "gnome-themes-extra" "papirus-icon-theme" | ||
436 | "arc-theme" | ||
437 | |||
438 | "fd" | ||
439 | "nautilus" | ||
440 | "qbittorrent" | ||
441 | "kdenlive" "gimp" | ||
442 | "blender" | ||
443 | |||
444 | "ripgrep" "curl")))))) | ||
445 | |||
446 | (define-public (feature-nonfree-kernel) | ||
447 | (feature-kernel | ||
448 | #:kernel linux | ||
449 | #:firmware (list linux-firmware) | ||
450 | #:initrd microcode-initrd)) | ||
451 | |||
452 | (define-public %all-features | ||
453 | (append | ||
454 | %base-features | ||
455 | %cli-features | ||
456 | %desktop-features | ||
457 | %dev-features | ||
458 | %emacs-features | ||
459 | %mail-features | ||
460 | %virtualization-features)) | ||
461 | |||
462 | (define-public %user-features | ||
463 | (append | ||
464 | %all-features | ||
465 | (list | ||
466 | (feature-user-info | ||
467 | #:user-name "jakub" | ||
468 | #:full-name "Jakub Dlugosz" | ||
469 | #:email "me@jdlugosz.com" | ||
470 | #:user-initial-password-hash | ||
471 | "$6$C6xUaxw3xOpsPrBF$/nmP.SXpzoAYGu7CrcIMQ02S4f8QDNZTuAyaIZusmz4e3xXTdSYpt8D1WCaLXcAuhVJA5llPf9MH7L1TTlgG81" | ||
472 | #:emacs-advanced-user? #t) | ||
473 | (feature-gnupg | ||
474 | #:gpg-primary-key "83AD9E56AE266488CA2F2598BACE123052C9E77A") | ||
475 | (feature-security-token) | ||
476 | (feature-password-store | ||
477 | #:password-store-directory "/home/jakub/.password-store" | ||
478 | #:remote-password-store-url "ssh://git@jdlugosz.com:passwords") | ||
479 | (feature-mail-settings | ||
480 | #:mail-directory-fn (lambda (config) | ||
481 | (string-append (get-value 'home-directory config) "/Mail")) | ||
482 | #:mail-accounts (list | ||
483 | (mail-account | ||
484 | (id 'work) | ||
485 | (type 'migadu) | ||
486 | (fqda "me@jdlugosz.com") | ||
487 | (aliases '("admin@jdlugosz.com" "postmaster@jdlugosz.com")) | ||
488 | (pass-cmd "pass show mail/me@jdlugosz.com"))) | ||
489 | #:mailing-lists (list (mail-lst 'guile-devel "guile-devel@gnu.org" | ||
490 | '("https://yhetil.org/guile-devel/0")) | ||
491 | (mail-lst 'guix-devel "guix-devel@gnu.org" | ||
492 | '("https://yhetil.org/guix-devel/0")) | ||
493 | (mail-lst 'guix-bugs "guix-bugs@gnu.org" | ||
494 | '("https://yhetil.org/guix-bugs/0")) | ||
495 | (mail-lst 'guix-patches "guix-patches@gnu.org" | ||
496 | '("https://yhetil.org/guix-patches/1")))) | ||
497 | (feature-irc-settings #:irc-accounts (list | ||
498 | (irc-account | ||
499 | (id 'libera) | ||
500 | (network "irc.libera.chat") | ||
501 | (nick "jdlugosz963")))) | ||
502 | (feature-sourcehut | ||
503 | #:user-name-fn (const "jdlugosz963")) | ||
504 | (feature-keyboard | ||
505 | #:keyboard-layout (keyboard-layout "pl")) | ||
506 | (feature-ssh-extra-config) | ||
507 | (feature-additional-services)))) | ||