summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2024-04-26 18:21:56 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2024-04-27 18:20:11 +0200
commit73af89d935df5a8166114c9257f9f247f29850bf (patch)
treec8addfe86575b030ca5a61644dbc77adb8f63c43
parent9ca1ae3ceca5944765af94514e75a96195de5716 (diff)
downloaddotfiles-73af89d935df5a8166114c9257f9f247f29850bf.tar.gz
dotfiles-73af89d935df5a8166114c9257f9f247f29850bf.zip
Migrate from stumpwm to sway and from manifests to home-services.
-rwxr-xr-x.bin/chiaki21
-rwxr-xr-x.bin/oath14
-rwxr-xr-x.bin/whois-at-hsp84
-rw-r--r--.config/guix/manifests/desktop.scm73
-rw-r--r--.config/guix/manifests/emacs.scm126
-rw-r--r--.config/sway/config193
-rw-r--r--.config/waybar/config159
-rw-r--r--.config/waybar/style.css205
-rwxr-xr-x.emacs.d/init.el10
-rwxr-xr-x.emacs.d/jd/jd-custom.el16
-rwxr-xr-x.emacs.d/jd/jd-keys.el10
-rwxr-xr-x.emacs.d/jd/jd-org.el2
-rwxr-xr-x.emacs.d/jd/jd-ui.el15
-rw-r--r--guix/jd/desktops/base.scm128
-rw-r--r--guix/jd/desktops/mimir.scm6
-rw-r--r--guix/jd/home/services/desktop.scm178
-rw-r--r--guix/jd/home/services/emacs.scm112
-rw-r--r--guix/jd/packages/emacs.scm57
-rw-r--r--guix/jd/utils.scm21
19 files changed, 1135 insertions, 295 deletions
diff --git a/.bin/chiaki b/.bin/chiaki
new file mode 100755
index 0000000..5fa6547
--- /dev/null
+++ b/.bin/chiaki
@@ -0,0 +1,21 @@
1#!/bin/sh
2
3CHIAKI_SHELL=/tmp/.chiaki.nix
4
5cat <<EOF > $CHIAKI_SHELL
6let
7 nixgl = import (fetchTarball https://github.com/guibou/nixGL/archive/main.tar.gz) { };
8in
9{ nixpkgs ? import <nixpkgs> {} }:
10with nixpkgs; mkShell {
11 buildInputs = [
12 chiaki
13 nixgl.auto.nixGLDefault
14 ];
15 shellHook = ''
16 nixGL chiaki && exit;
17 '';
18}
19EOF
20
21nix-shell $CHIAKI_SHELL
diff --git a/.bin/oath b/.bin/oath
new file mode 100755
index 0000000..7444993
--- /dev/null
+++ b/.bin/oath
@@ -0,0 +1,14 @@
1#!/bin/sh
2
3if [[ $1 ]]; then
4 PASS=$(oathtool -b --totp $(pass show "oath/$1"))
5 printf $PASS | wl-copy
6 echo "pass: $PASS"
7 echo "Password should be in your clipboard!"
8else
9 echo "Usage: oath <pass>"
10 echo "Available pass:"
11 pass oath
12fi
13
14
diff --git a/.bin/whois-at-hsp b/.bin/whois-at-hsp
new file mode 100755
index 0000000..0cd03f7
--- /dev/null
+++ b/.bin/whois-at-hsp
@@ -0,0 +1,84 @@
1#!/usr/bin/env -S guix shell guile guile-json -- guile --no-auto-compile -e main -s
2-*- scheme -*-
3!#
4
5(use-modules (srfi srfi-1)
6 (ice-9 iconv)
7 (ice-9 receive)
8 (web client)
9 (json))
10
11(define whois-at-hsp-endpoint "https://whois.at.hsp.sh/api/now")
12
13(define (http-get-serialize-json url)
14 (receive (response data) (http-request url)
15 (values (json-string->scm (bytevector->string data "UTF-8"))
16 response)))
17
18(define (whois-data->users whois-data)
19 (assoc-ref whois-data "users"))
20
21(define (whois-data->unknown-devices whois-data)
22 (assoc-ref whois-data "unknown_devices"))
23
24(define (whois-data->head-count whois-data)
25 (assoc-ref whois-data "headcount"))
26
27(define (whois-data->formated-users whois-data)
28 (let ((users (vector->list (whois-data->users whois-data))))
29 (if (> (length users) 0)
30 (fold-right
31 (lambda (a b) (string-append a " " b))
32 ""
33 users)
34 "No visible users!")))
35
36(define (whois-data->summary whois-data)
37 (string-append
38 "Unknown devices: "
39 (number->string (whois-data->unknown-devices whois-data))
40 "\nUsers: [" (number->string (whois-data->head-count whois-data)) "] "
41 (whois-data->formated-users whois-data)))
42
43(define (notify data)
44 (system* "notify-send"
45 "WHOIS AT HSP"
46 (whois-data->summary data)))
47
48(define (command-line-option? option args)
49 (> (length (or (member option args)
50 '()))
51 0))
52
53(define-syntax-rule (command-line-args-handle args default ((option ...) body ...) ...)
54 (let ((option? (lambda (o) (command-line-option? o args)))
55 (something-executed? #f))
56 (when (or (option? option) ...)
57 (set! something-executed? #t)
58 body ...) ...
59 (when (not something-executed?)
60 default)))
61
62(define (main args)
63 (let ((whois-data (http-get-serialize-json whois-at-hsp-endpoint)))
64 (command-line-args-handle args
65 (begin (display (whois-data->summary whois-data))
66 (newline))
67 (("-h" "--help")
68 (display (string-append "-h, --help Help message\n"
69 "-n, --notify Notification massage with whois information.\n"
70 "-u Get users\n"
71 "-H Get head count\n"
72 "-U Get unknown devices\n")))
73 (("-n" "--notify")
74 (notify whois-data))
75 (("-u")
76 (display (whois-data->formated-users whois-data))
77 (newline))
78 (("-H")
79 (display (whois-data->head-count whois-data))
80 (newline))
81 (("-U")
82 (display (whois-data->unknown-devices whois-data))
83 (newline)))))
84
diff --git a/.config/guix/manifests/desktop.scm b/.config/guix/manifests/desktop.scm
deleted file mode 100644
index f238951..0000000
--- a/.config/guix/manifests/desktop.scm
+++ /dev/null
@@ -1,73 +0,0 @@
1(specifications->manifest
2 '("qutebrowser"
3 "ungoogled-chromium"
4 "firefox"
5 "tor-client"
6
7 "pulsemixer"
8 "pavucontrol"
9 "alsa-utils"
10
11 "virt-manager"
12
13 "flatpak"
14 "redshift"
15 "fontmanager"
16
17 "polybar"
18
19 "blueman"
20
21 "xdg-utils"
22 "xdg-dbus-proxy"
23 "xdg-desktop-portal-gtk"
24 "glib:bin"
25 "gtk+:bin"
26 "gnome-keyring"
27 "shared-mime-info"
28 "libnotify"
29 "dconf"
30 "hicolor-icon-theme"
31
32 "dunst"
33
34 "gimp"
35 "inkscape"
36
37 "mpv"
38 "youtube-dl"
39
40 "pamixer"
41 "playerctl"
42 "scrot"
43 "brightnessctl"
44 "upower"
45 "tlp"
46 "feh"
47 "alacritty"
48
49 "curl"
50 "wget"
51 "zip"
52 "unzip"
53 "qrencode"
54 "trash-cli"
55 "pandoc"
56 "password-store"
57 "pinentry"
58
59 "syncthing"
60 "syncthing-gtk"
61
62 "xmodmap"
63 "xrandr"
64 "arandr"
65 "xss-lock"
66 "libinput"
67 "xinput"
68 "xprop"
69 "rlwrap"
70
71 "nheko"
72 "quassel"
73 ))
diff --git a/.config/guix/manifests/emacs.scm b/.config/guix/manifests/emacs.scm
deleted file mode 100644
index db809eb..0000000
--- a/.config/guix/manifests/emacs.scm
+++ /dev/null
@@ -1,126 +0,0 @@
1;; This file is auto-generated by Emacs function: jd/manifest-generate-to-file
2(use-modules (gnu packages emacs-xyz)
3 (gnu packages)
4 (guix packages)
5 (guix git-download)
6 (guix build-system emacs)
7 ((guix licenses) #:prefix license:))
8
9
10(define-public emacs-org-roam-ui
11 (let ((commit "9474a254390b1e42488a1801fed5826b32a8030b")
12 (revision "0"))
13 (package
14 (name "emacs-org-roam-ui")
15 (version (git-version "0" revision commit))
16 (source (origin
17 (method git-fetch)
18 (uri (git-reference
19 (url "https://github.com/org-roam/org-roam-ui")
20 (commit commit)))
21 (file-name (git-file-name name version))
22 (sha256
23 (base32
24 "0v54vxh95izch74wz2dl2dkdqicbvshra55l6qvd4xl5qmfhpjdc"))))
25 (build-system emacs-build-system)
26 (arguments
27 `(#:include (cons "^out" %default-include)))
28 (propagated-inputs
29 (list emacs-org-roam emacs-websocket emacs-simple-httpd emacs-f))
30 (home-page "https://github.com/org-roam/org-roam-ui")
31 (synopsis "A graphical frontend for your org-roam Zettelkasten")
32 (description " Org-Roam-UI is a frontend for exploring and interacting
33with your @code{org-roam} notes. It is meant a successor of
34@code{org-roam-server} that extends functionality of org-roam with a Web app
35that runs side-by-side with Emacs.")
36 (license license:gpl3+))))
37
38
39
40(define emacs-lsp-mode--new
41 (let ((commit "808c4d0ab9f19bb92c56716cf59df89432b63f5d")
42 (revision "1"))
43 (package
44 (inherit emacs-lsp-mode)
45 (name "emacs-lsp-mode")
46 (version (git-version "8.0.1" revision commit))
47 (source
48 (origin
49 (method git-fetch)
50 (uri (git-reference
51 (url "https://github.com/emacs-lsp/lsp-mode")
52 (commit commit)))
53 (file-name (git-file-name name version))
54 (sha256
55 (base32 "0ridjhzndwjj8947vabq05njgnns74hi69x77axgcbv1c4nasz2y")))))))
56
57
58(define emacs-packages
59 (specifications->manifest
60 '("emacs-ytdl"
61 "emacs-desktop-environment"
62 "emacs-exwm"
63 "emacs-perspective"
64 "emacs-mu4e-alert"
65 "mu"
66 "isync"
67 "emacs-htmlize"
68 "emacs-bluetooth"
69 "emacs-nov-el"
70 "emacs-password-store"
71 "emacs-mastodon"
72 "emacs-elfeed"
73 "emacs-pdf-tools"
74 "emacs-emms"
75 "emacs-all-the-icons-dired"
76 "emacs-vterm"
77 "emacs-restclient"
78 "emacs-magit"
79 "emacs-neotree"
80 "emacs-projectile"
81 "emacs-company-box"
82 "emacs-company"
83 "emacs-docker"
84 "emacs-yaml-mode"
85 "emacs-web-mode"
86 "emacs-flycheck"
87 "emacs-tide"
88 "emacs-cider"
89 "emacs-typescript-mode"
90 "emacs-pyvenv"
91 "emacs-geiser-guile"
92 "emacs-racket-mode"
93 "emacs-geiser-racket"
94 "emacs-geiser"
95 "emacs-sly"
96 "emacs-rainbow-delimiters"
97 "emacs-paredit"
98 ;; "emacs-lsp-ivy"
99 ;; "emacs-lsp-mode"
100 "emacs-org-roam"
101 "emacs-org-roam-bibtex"
102 "emacs-org-superstar"
103 "emacs-org"
104 "emacs-ox-pandoc"
105 "emacs-beacon"
106 "emacs-all-the-icons"
107 "emacs-which-key"
108 "emacs-counsel"
109 "emacs-ivy"
110 "emacs-hl-todo"
111 "emacs-diminish"
112 "emacs-solarized-theme"
113 "font-terminus"
114 "emacs-undo-tree"
115 "emacs-hydra"
116 "emacs-general"
117 "emacs-guix"
118 "emacs"
119 "emacs-use-package"
120 )))
121
122
123(concatenate-manifests
124 (list emacs-packages
125 (packages->manifest (list emacs-lsp-mode--new
126 emacs-org-roam-ui))))
diff --git a/.config/sway/config b/.config/sway/config
new file mode 100644
index 0000000..2807f08
--- /dev/null
+++ b/.config/sway/config
@@ -0,0 +1,193 @@
1set $mod Mod4
2
3set $left h
4set $down j
5set $up k
6set $right l
7
8set $term alacritty
9set $emacs emacsclient -c
10set $menu fuzzel -r0 -b 282828f2 -C 458588f2 -B 3 -s 458588f2 -S 282828FF --font "Terminus:size=12" -p "run: "
11
12set $laptop-display eDP-1
13set $generic-display HDMI-A-1
14set $primary-home-display 'Iiyama North America PLE2407HDSD 0x01010101'
15set $secondary-home-display 'Dell Inc. DELL E190S M8VPV186CELI'
16
17set $primary-display-layout $primary-home-display $generic-display $laptop-display
18set $secondary-display-layout $secondary-home-display $laptop-display
19
20output * bg SPOILER_33.png fill
21
22output $laptop-display resolution 1920x1080 position 1920,0
23output $generic-display resolution 1920x1080 position 0,0
24output $primary-home-display resolution 1920x1080 position 0,0
25output $secondary-home-display resolution 1280x1024 position 1920,0
26set $opacity 0.9
27
28client.focused #002b36 #586e75 #eee8d5 #268bd2
29client.focused_inactive #002b36 #073642 #93a1a1 #268bd2
30client.unfocused #002b36 #073642 #93a1a1 #268bd2
31client.urgent #002b36 #dc322f #fdf6e3 #002b36
32
33input type:keyboard {
34 xkb_layout pl,us
35}
36
37input type:touchpad {
38 tap enabled
39 middle_emulation enabled
40}
41
42bindsym $mod+Shift+s output $laptop-display toggle
43
44set $swaylock 'swaylock -f -c 000000 --font "Terminus"'
45exec swayidle -w \
46 timeout 280 $swaylock \
47 timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
48 before-sleep $swaylock
49
50# inhibit_idle fullscreen
51
52bindsym $mod+Escape exec $swaylock
53
54bindsym XF86MonBrightnessUp exec brightnessctl set 5%+
55bindsym XF86MonBrightnessDown exec brightnessctl set 5%-
56
57bindsym XF86AudioMute exec pactl set-sink-mute @DEFAULT_SINK@ toggle
58bindsym XF86AudioRaiseVolume exec pactl set-sink-volume @DEFAULT_SINK@ +5%
59bindsym XF86AudioLowerVolume exec pactl set-sink-volume @DEFAULT_SINK@ -5%
60
61bindsym XF86AudioNext exec playerctl next
62bindsym XF86AudioPrev exec playerctl previous
63bindsym XF86AudioPlay exec playerctl play-pause
64bindsym XF86AudioPause exec playerctl pause
65
66bindsym print exec grimshot --notify copy area
67bindsym $mod+print exec grimshot --notify copy output
68
69bindsym $mod+Return exec $term
70
71bindsym $mod+Shift+q kill
72
73floating_modifier $mod normal
74
75bindsym $mod+Shift+c reload
76bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -B 'Yes, exit sway' 'swaymsg exit'
77
78bindsym $mod+$left focus left
79bindsym $mod+$down focus down
80bindsym $mod+$up focus up
81bindsym $mod+$right focus right
82
83bindsym $mod+Shift+$left move left
84bindsym $mod+Shift+$down move down
85bindsym $mod+Shift+$up move up
86bindsym $mod+Shift+$right move right
87
88workspace 1 output $primary-display-layout
89workspace 2 output $primary-display-layout
90workspace 3 output $secondary-display-layout
91workspace 4 output $secondary-display-layout
92workspace 9 output $primary-display-layout
93workspace 10 output $secondary-display-layout
94
95bindsym $mod+1 workspace number 1
96bindsym $mod+2 workspace number 2
97bindsym $mod+3 workspace number 3
98bindsym $mod+4 workspace number 4
99bindsym $mod+5 workspace number 5
100bindsym $mod+6 workspace number 6
101bindsym $mod+7 workspace number 7
102bindsym $mod+8 workspace number 8
103bindsym $mod+9 workspace number 9
104bindsym $mod+0 workspace number 10
105
106bindsym $mod+Shift+1 move container to workspace number 1
107bindsym $mod+Shift+2 move container to workspace number 2
108bindsym $mod+Shift+3 move container to workspace number 3
109bindsym $mod+Shift+4 move container to workspace number 4
110bindsym $mod+Shift+5 move container to workspace number 5
111bindsym $mod+Shift+6 move container to workspace number 6
112bindsym $mod+Shift+7 move container to workspace number 7
113bindsym $mod+Shift+8 move container to workspace number 8
114bindsym $mod+Shift+9 move container to workspace number 9
115bindsym $mod+Shift+0 move container to workspace number 10
116
117assign [app_id="(firefox-default|qutebrowser|Chromium-browser)"] 2
118assign [instance="(chromium-browser)"] 2
119assign [instance="(spotify)"] 3
120assign [app_id=".blueman-manager-real"] 3
121assign [app_id="pavucontrol"] 3
122assign [app_id="(org.telegram.desktop)"] 4
123assign [app_id="vesktop"] 4
124assign [app_id="com.ktechpit.whatsie"] 4
125assign [instance="(discord)"] 4
126
127for_window [app_id="vesktop"] opacity $opacity
128
129
130bindsym $mod+b splith
131bindsym $mod+v splitv
132
133bindsym $mod+s layout stacking
134bindsym $mod+w layout tabbed
135bindsym $mod+e layout toggle split
136
137bindsym $mod+f fullscreen
138bindsym $mod+Shift+space floating toggle
139bindsym $mod+space focus mode_toggle
140bindsym $mod+a focus parent
141
142bindsym $mod+Shift+minus move scratchpad
143bindsym $mod+minus scratchpad show
144
145mode "resize" {
146 bindsym $left resize shrink width 10px
147 bindsym $down resize grow height 10px
148 bindsym $up resize shrink height 10px
149 bindsym $right resize grow width 10px
150
151 bindsym Return mode "default"
152 bindsym Control+g mode "default"
153 bindsym Escape mode "default"
154}
155bindsym $mod+r mode "resize"
156
157set $default swaymsg mode default
158mode "menu" {
159 bindsym --no-repeat e exec '$default; $emacs;'
160 bindsym --no-repeat w exec "$default; whois-at-hsp -n"
161
162 bindsym Return mode "default"
163 bindsym Control+g mode "default"
164 bindsym Escape mode "default"
165
166}
167bindsym $mod+o mode "menu"
168
169
170workspace_layout tabbed
171
172default_border normal 3
173gaps outer 0
174gaps inner 6
175font Terminus (TTF) 12
176corner_radius 4
177blur_xray disable
178blur enable
179layer_effects "waybar" blur enable
180bindsym $mod+p exec $menu
181
182
183# Taken from dawivil dotfiles.
184exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
185
186# exec udiskie -t
187exec mako --font "Terminus (TTF)" --outer-margin=5 --margin=3 --border-size=3 --default-timeout=7000 --background="#282828e0"
188
189exec nm-applet --indicator
190exec blueman-applet
191exec waybar
192exec udiskie -t
193exec wlsunset -l 51.919438 -L 19.145136
diff --git a/.config/waybar/config b/.config/waybar/config
new file mode 100644
index 0000000..5ebee30
--- /dev/null
+++ b/.config/waybar/config
@@ -0,0 +1,159 @@
1{
2 "layer": "top",
3 "position": "top",
4
5 "modules-left": [
6 "sway/workspaces",
7 "sway/mode"
8 ],
9
10 "modules-right": [
11// "custom/whois",
12 "pulseaudio",
13 "network",
14 "memory",
15 "cpu",
16 "temperature",
17 "battery",
18 "sway/language",
19 "clock#date",
20 "clock#time",
21 "idle_inhibitor",
22 "tray"
23 ],
24
25 // Modules
26 "idle_inhibitor": {
27 "format": "{icon}",
28 "format-icons": {
29 "activated": "",
30 "deactivated": ""
31 }
32 },
33
34 "battery": {
35 "interval": 10,
36 "states": {
37 "warning": 30,
38 "critical": 15
39 },
40 "format-time": "{H}:{M:02}",
41 "format": "{icon} {capacity}% ({time})",
42 "format-charging": " {capacity}% ({time})",
43 "format-charging-full": " {capacity}%",
44 "format-full": "{icon} {capacity}%",
45 "format-alt": "{icon} {power}W",
46 "format-icons": [
47 "",
48 "",
49 "",
50 "",
51 ""
52 ],
53 "tooltip": false
54 },
55
56 "clock#time": {
57 "interval": 10,
58 "format": "{:%H:%M}",
59 "tooltip": false
60 },
61
62 "clock#date": {
63 "interval": 20,
64 "format": " {:%e %b %Y}",
65 "tooltip": false
66 //"tooltip-format": "{:%e %B %Y}"
67 },
68
69 "cpu": {
70 "interval": 5,
71 "tooltip": false,
72 "format": " {usage}%",
73 "format-alt": " {load}",
74 "states": {
75 "warning": 70,
76 "critical": 90
77 }
78 },
79
80 "sway/language": {
81 "format": " {}",
82 "min-length": 5,
83 "on-click": "swaymsg 'input * xkb_switch_layout next'",
84 "tooltip": false
85 },
86
87 "memory": {
88 "interval": 5,
89 "format": " {used:0.1f}G/{total:0.1f}G",
90 "states": {
91 "warning": 70,
92 "critical": 90
93 },
94 "tooltip": false
95 },
96
97 "network": {
98 "interval": 5,
99 "format-wifi": " {essid} ({signalStrength}%)",
100 "format-ethernet": " {ifname}",
101 "format-disconnected": "No connection",
102 "format-alt": " {ipaddr}/{cidr}",
103 "tooltip": false
104 },
105
106 "sway/mode": {
107 "format": "{}",
108 "tooltip": false
109 },
110
111 "sway/window": {
112 "format": "{}",
113 "max-length": 30,
114 "tooltip": false
115 },
116
117 "sway/workspaces": {
118 "disable-scroll-wraparound": true,
119 "smooth-scrolling-threshold": 4,
120 "enable-bar-scroll": true,
121 "format": "{name}"
122 },
123
124 "pulseaudio": {
125 "format": "{icon} {volume}%",
126 "format-bluetooth": "{icon} {volume}%",
127 "format-muted": "",
128 "format-icons": {
129 "headphone": "",
130 "hands-free": "",
131 "headset": "",
132 "phone": "",
133 "portable": "",
134 "car": "",
135 "default": ["", ""]
136 },
137 "scroll-step": 1,
138 "on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
139 "tooltip": false
140 },
141
142 "temperature": {
143 "critical-threshold": 90,
144 "interval": 5,
145 "format": "{icon} {temperatureC}°",
146 "format-icons": [
147 "",
148 "",
149 "",
150 "",
151 ""
152 ],
153 "tooltip": false
154 },
155
156 "tray": {
157 "icon-size": 18,
158 }
159}
diff --git a/.config/waybar/style.css b/.config/waybar/style.css
new file mode 100644
index 0000000..53d732b
--- /dev/null
+++ b/.config/waybar/style.css
@@ -0,0 +1,205 @@
1/* Keyframes */
2
3@keyframes blink-critical {
4 to {
5 /*color: @white;*/
6 background-color: @critical;
7 }
8}
9
10
11/* Styles */
12
13/* Colors (gruvbox) */
14@define-color black #073642;
15@define-color red #dc322f;
16@define-color green #859900;
17@define-color yellow #b58900;
18@define-color blue #268bd2;
19@define-color purple #d33682;
20@define-color aqua #00afaf;
21@define-color gray #1c1c1c;
22@define-color brgray #928374;
23@define-color brred #cb4b16;
24@define-color brgreen #586e75;
25@define-color bryellow #657b83;
26@define-color brblue #839496;
27@define-color brpurple #6c71c4;
28@define-color braqua #93a1a1;
29@define-color white #eee8d5;
30@define-color bg1 #073642;
31@define-color bg2 #002b36;
32
33
34@define-color warning @bryellow;
35@define-color critical @red;
36@define-color mode @bg2;
37@define-color unfocused @bg2;
38@define-color focused @blue;
39@define-color inactive @purple;
40@define-color sound @green;
41@define-color network @yellow;
42@define-color memory @aqua;
43@define-color cpu @blue;
44@define-color temp @brpurple;
45@define-color layout @green;
46@define-color battery @yellow;
47@define-color date @aqua;
48@define-color time @bg2;
49@define-color tray @bg2;
50
51/* Reset all styles */
52* {
53 border: none;
54 border-radius: 0;
55 min-height: 0;
56 margin: 0;
57 padding: 0;
58 box-shadow: none;
59 text-shadow: none;
60 icon-shadow: none;
61}
62
63/* The whole bar */
64#waybar {
65 background: @bg2;
66 color: @white;
67 font-family: "Terminus (TTF)", FontAwesome;
68 font-size: 12pt;
69}
70
71/* Each module */
72#battery,
73#clock,
74#cpu,
75#language,
76#memory,
77#mode,
78#network,
79#pulseaudio,
80#temperature,
81#tray,
82#backlight,
83#idle_inhibitor,
84#disk,
85#user,
86#mpris {
87 padding-left: 8pt;
88 padding-right: 8pt;
89}
90
91/* Each critical module */
92#memory.critical,
93#cpu.critical,
94#temperature.critical,
95#battery.critical.discharging {
96 animation-timing-function: linear;
97 animation-iteration-count: infinite;
98 animation-direction: alternate;
99 animation-name: blink-critical;
100 animation-duration: 1s;
101}
102
103/* Each warning */
104#network.disconnected,
105#memory.warning,
106#cpu.warning,
107#temperature.warning,
108#battery.warning.discharging {
109 color: @warning;
110}
111
112/* And now modules themselves in their respective order */
113
114/* Current sway mode (resize etc) */
115#mode {
116 color: @white;
117 background: @mode;
118}
119
120/* Workspaces stuff */
121#workspaces button {
122 /*font-weight: bold;*/
123 padding-left: 2pt;
124 padding-right: 2pt;
125 color: @white;
126 background: @unfocused;
127}
128
129/* Inactive (on unfocused output) */
130#workspaces button.visible {
131 color: @white;
132 background: @inactive;
133}
134
135/* Active (on focused output) */
136#workspaces button.focused {
137 color: @black;
138 background: @focused;
139}
140
141/* Contains an urgent window */
142#workspaces button.urgent {
143 color: @black;
144 background: @warning;
145}
146
147/* Style when cursor is on the button */
148#workspaces button:hover {
149 background: @black;
150 color: @white;
151}
152
153#window {
154 margin-right: 35pt;
155 margin-left: 35pt;
156}
157
158#pulseaudio {
159 background: @sound;
160 color: @black;
161}
162
163#network {
164 background: @network;
165 color: @white;
166}
167
168#memory {
169 background: @memory;
170 color: @black;
171}
172
173#cpu {
174 background: @cpu;
175 color: @white;
176}
177
178#temperature {
179 background: @temp;
180 color: @black;
181}
182
183#language {
184 background: @layout;
185 color: @black;
186}
187
188#battery {
189 background: @battery;
190 color: @white;
191}
192
193#tray {
194 background: @tray;
195}
196
197#clock.date {
198 background: @date;
199 color: @black;
200}
201
202#clock.time {
203 background: @time;
204 color: @white;
205}
diff --git a/.emacs.d/init.el b/.emacs.d/init.el
index 96b81da..a0cb8a0 100755
--- a/.emacs.d/init.el
+++ b/.emacs.d/init.el
@@ -3,7 +3,13 @@
3 3
4;;; Code: 4;;; Code:
5 5
6(setq gc-cons-threshold (* 50 1000 1000)) 6;; Minimize garbage collection during startup
7(setq gc-cons-threshold most-positive-fixnum)
8
9;; Lower threshold back to 8 MiB (default is 800kB)
10(add-hook 'emacs-startup-hook
11 (lambda ()
12 (setq gc-cons-threshold (expt 2 23))))
7 13
8(defvar jd/manifest-list 14(defvar jd/manifest-list
9 nil 15 nil
@@ -119,7 +125,7 @@
119(when jd/exwm-p 125(when jd/exwm-p
120 (require 'jd-exwm)) 126 (require 'jd-exwm))
121 127
122(setq gc-cons-threshold (* 2 1000 1000)) 128;; (setq gc-cons-threshold (* 2 1000 1000))
123 129
124;;; init.el ends here 130;;; init.el ends here
125(put 'upcase-region 'disabled nil) 131(put 'upcase-region 'disabled nil)
diff --git a/.emacs.d/jd/jd-custom.el b/.emacs.d/jd/jd-custom.el
index f48f761..8383e41 100755
--- a/.emacs.d/jd/jd-custom.el
+++ b/.emacs.d/jd/jd-custom.el
@@ -39,6 +39,22 @@
39 (erc :server "195.74.91.18" 39 (erc :server "195.74.91.18"
40 :port "6697")) 40 :port "6697"))
41 41
42
43;; Repair load paths when tramp try to connect to guix instances
44(require 'tramp)
45
46(connection-local-set-profile-variables
47 'guix-system
48 '((tramp-remote-path . (tramp-own-remote-path))))
49
50(connection-local-set-profiles
51 '(:application tramp :protocol "sudo" :machine "localhost")
52 'guix-system)
53
54(connection-local-set-profiles
55 '(:application tramp :protocol "ssh" :machine "jdlugosz.com")
56 'guix-system)
57
42(provide 'jd-custom) 58(provide 'jd-custom)
43 59
44;;; jd-custom.el ends here 60;;; jd-custom.el ends here
diff --git a/.emacs.d/jd/jd-keys.el b/.emacs.d/jd/jd-keys.el
index 7c0d6b2..26a6445 100755
--- a/.emacs.d/jd/jd-keys.el
+++ b/.emacs.d/jd/jd-keys.el
@@ -16,6 +16,16 @@
16;; (evil-set-initial-state 'exwm-mode 'emacs) 16;; (evil-set-initial-state 'exwm-mode 'emacs)
17;; (evil-mode 1)) 17;; (evil-mode 1))
18 18
19(jd/use-package multiple-cursors "emacs-multiple-cursors"
20 :config
21 (global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines)
22 (global-set-key (kbd "C->") 'mc/mark-next-like-this)
23 (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
24 (global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this))
25
26(jd/use-package shackle "emacs-shackle")
27(jd/use-package sway "emacs-sway")
28
19(jd/use-package general "emacs-general" 29(jd/use-package general "emacs-general"
20 :config 30 :config
21 (general-create-definer jd/leader-key-def 31 (general-create-definer jd/leader-key-def
diff --git a/.emacs.d/jd/jd-org.el b/.emacs.d/jd/jd-org.el
index f511846..a9565f3 100755
--- a/.emacs.d/jd/jd-org.el
+++ b/.emacs.d/jd/jd-org.el
@@ -16,6 +16,8 @@
16 (let ((d (or date "+0d"))) 16 (let ((d (or date "+0d")))
17 (org-insert-time-stamp (org-read-date nil t d)))) 17 (org-insert-time-stamp (org-read-date nil t d))))
18 18
19(jd/use-package org-pomodoro "emacs-org-pomodoro")
20
19(jd/use-package org "emacs-org" 21(jd/use-package org "emacs-org"
20 :pin org 22 :pin org
21 :commands (org-capture org-agenda) 23 :commands (org-capture org-agenda)
diff --git a/.emacs.d/jd/jd-ui.el b/.emacs.d/jd/jd-ui.el
index f75711b..f3a39bc 100755
--- a/.emacs.d/jd/jd-ui.el
+++ b/.emacs.d/jd/jd-ui.el
@@ -11,11 +11,13 @@
11(menu-bar-mode -1) 11(menu-bar-mode -1)
12(set-fringe-mode 10) 12(set-fringe-mode 10)
13 13
14(jd/add-package-to-manifest "font-terminus") 14(set-frame-parameter (selected-frame) 'alpha '(92 . 92))
15 15(add-to-list 'default-frame-alist '(alpha . (92 . 92)))
16 16
17(custom-set-faces 17(custom-set-faces
18 '(default ((t (:inherit nil :height 100 :family "Terminus"))))) 18 '(default ((t (:inherit nil :height 125 :family "Terminus"))))
19 '(line-number ((t (:inherit nil :height 125 :family "Terminus"))))
20 '(line-number-current-line ((t (:inherit nil :height 125 :family "Terminus")))))
19 21
20(add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative) 22(add-hook 'prog-mode-hook 'menu-bar--display-line-numbers-mode-relative)
21 23
@@ -27,9 +29,14 @@
27 29
28(require 'diminish) 30(require 'diminish)
29 31
32(jd/use-package doom-modeline "emacs-doom-modeline"
33 :config
34 (doom-modeline-mode))
35
30(jd/use-package solarized-theme "emacs-solarized-theme" 36(jd/use-package solarized-theme "emacs-solarized-theme"
31 :config 37 :config
32 (load-theme 'solarized-selenized-black t)) 38 (load-theme 'solarized-dark-high-contrast t))
39
33 40
34(jd/use-package diminish "emacs-diminish") 41(jd/use-package diminish "emacs-diminish")
35 42
diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm
index db95939..c613c26 100644
--- a/guix/jd/desktops/base.scm
+++ b/guix/jd/desktops/base.scm
@@ -1,6 +1,7 @@
1(define-module (jd desktops base) 1(define-module (jd desktops base)
2 #:use-module (jd home services polkit) 2 #:use-module (jd home services polkit)
3 #:use-module (jd home services desktop) 3 #:use-module (jd home services desktop)
4 #:use-module (jd home services emacs)
4 #:use-module (jd services polkit) 5 #:use-module (jd services polkit)
5 6
6 #:use-module (gnu) 7 #:use-module (gnu)
@@ -9,61 +10,46 @@
9 #:use-module (gnu home services desktop) 10 #:use-module (gnu home services desktop)
10 #:use-module (gnu home services gnupg) 11 #:use-module (gnu home services gnupg)
11 #:use-module (gnu home services xdg) 12 #:use-module (gnu home services xdg)
13 #:use-module (gnu home services sound)
12 #:use-module (gnu services) 14 #:use-module (gnu services)
15 #:use-module (guix packages)
13 16
14 #:use-module (nongnu packages linux) 17 #:use-module (nongnu packages linux)
15 #:use-module (nongnu system linux-initrd)) 18 #:use-module (nongnu system linux-initrd))
16 19
17(use-package-modules wm gnome gnupg networking virtualization 20(use-package-modules wm gnome networking virtualization
18 lisp lisp-xyz cups) 21 lisp lisp-xyz cups fonts gnupg)
19 22
20(use-service-modules cups desktop networking ssh xorg 23(use-service-modules cups desktop networking ssh xorg
21 docker virtualization pm sound dbus 24 docker virtualization pm sound dbus
22 nix) 25 nix sddm)
23 26
24(define-public %jd-base-home-services 27(define-public %jd-base-home-services
25 (list 28 (list
26 (service home-xdg-mime-applications-service-type 29 ;; (service home-redshift-service-type
27 (home-xdg-mime-applications-configuration 30 ;; (home-redshift-configuration
28 (default '((inode/directory . emacs-desktop.desktop) 31 ;; (location-provider 'manual)
29 (application/pdf . emacs-desktop.desktop))) 32 ;; (latitude 51.919438)
30 (desktop-entries 33 ;; (longitude 19.145136)))
31 (list (xdg-desktop-entry 34 ;; Poland
32 (file "emacs-desktop")
33 (name "Emacs")
34 (type 'application)
35 (config
36 '((exec . "emacsclient -a emacs %u"))))))))
37
38 (service home-redshift-service-type
39 (home-redshift-configuration
40 (location-provider 'manual)
41 (latitude 51.919438)
42 (longitude 19.145136))) ;; Poland
43
44 (simple-service 'some-useful-env-vars-service
45 home-environment-variables-service-type
46 `(("GTK_THEME" . "Adwaita:dark")
47 ("VISUAL" . "emacsclient")
48 ("EDITOR" . "emacsclient")
49 ("PATH" . "$HOME/.bin:$HOME/.npm-global/bin:$PATH")
50 ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share")
51 ("SBCL_HOME" . "/run/current-system/profile/lib/sbcl/")))
52
53 (service home-gpg-agent-service-type
54 (home-gpg-agent-configuration
55 (pinentry-program
56 (file-append pinentry "/bin/pinentry"))
57 (ssh-support? #t)
58 (default-cache-ttl 28800)
59 (max-cache-ttl 28800)
60 (default-cache-ttl-ssh 28800)
61 (max-cache-ttl-ssh 28800)))
62 35
63 (service home-dbus-service-type) 36 (service home-dbus-service-type)
64 37 (service home-emacs-service-type)
65 (service home-desktop-service-type) 38 (service home-desktop-service-type)
66 (service home-polkit-gnome-service-type))) 39
40 ;; Dont know why, but when i put home-gpg-agent-service-type as an
41 ;; extension in home-desktop-service-type service it doesn't work.
42 (service home-gpg-agent-service-type
43 (home-gpg-agent-configuration
44 (pinentry-program
45 (file-append pinentry-gnome3 "/bin/pinentry-gnome3"))
46 (ssh-support? #t)
47 (default-cache-ttl 28800)
48 (max-cache-ttl 28800)
49 (default-cache-ttl-ssh 28800)
50 (max-cache-ttl-ssh 28800)))
51 ;; (service home-polkit-gnome-service-type)
52 ))
67 53
68 54
69(define-public %jakub-user 55(define-public %jakub-user
@@ -82,7 +68,6 @@
82 "audio" ;; control audio devices 68 "audio" ;; control audio devices
83 "video" ;; access to webcam 69 "video" ;; access to webcam
84 "dialout" ;; access to /dev/ttyUSBX devices 70 "dialout" ;; access to /dev/ttyUSBX devices
85 "adbusers"
86 )))) 71 ))))
87 72
88(define-public %jd-base-user-accounts 73(define-public %jd-base-user-accounts
@@ -105,6 +90,8 @@
105 sbcl-stumpwm-battery-portable 90 sbcl-stumpwm-battery-portable
106 sbcl-stumpwm-stumptray 91 sbcl-stumpwm-stumptray
107 92
93 sbcl-stumpwm-ttf-fonts
94
108 sbcl-drakma 95 sbcl-drakma
109 sbcl-yason 96 sbcl-yason
110 97
@@ -121,21 +108,54 @@
121 "xf86-input-libinput" 108 "xf86-input-libinput"
122 "intel-vaapi-driver" 109 "intel-vaapi-driver"
123 "libva-utils" ;; vainfo 110 "libva-utils" ;; vainfo
124 "nss-certs" 111 ;; "nss-certs" -- it is in %base-packages from fdfd7667c66cf9ce746330f39bcd366e124460e1
125 "nix"))) 112 "nix")))
126 113
127(define-public %jd-base-packages 114(define-public %jd-base-packages
128 (append %root-packages 115 (append %root-packages
129 %stumpwm-packages 116 ;; %stumpwm-packages
130 %base-packages)) 117 %base-packages))
131 118
132(define-public %jd-base-services 119(define-public %jd-base-services
133 (cons* 120 (cons*
134 (service openssh-service-type) 121 (service openssh-service-type)
135 122
136 (set-xorg-configuration 123 ;; (set-xorg-configuration
137 (xorg-configuration ;for Xorg 124 ;; (xorg-configuration ;for Xorg
138 (keyboard-layout (keyboard-layout "pl")))) 125 ;; (keyboard-layout (keyboard-layout "pl"))))
126 ;; (service greetd-service-type
127 ;; (greetd-configuration
128 ;; ;; We need to give the greeter user these permissions, otherwise
129 ;; ;; Sway will crash on launch.
130 ;; (greeter-supplementary-groups (list "video" "input"))
131 ;; (terminals
132 ;; (list (greetd-terminal-configuration
133 ;; (terminal-vt "1")
134 ;; (terminal-switch #t))
135 ;; (greetd-terminal-configuration
136 ;; (terminal-vt "2"))
137 ;; (greetd-terminal-configuration
138 ;; (terminal-vt "3"))
139 ;; (greetd-terminal-configuration
140 ;; (terminal-vt "4"))
141 ;; (greetd-terminal-configuration
142 ;; (terminal-vt "5"))
143 ;; (greetd-terminal-configuration
144 ;; (terminal-vt "6"))))))
145
146 (service console-font-service-type
147 (map (lambda (tty)
148 (cons tty (file-append
149 font-terminus
150 "/share/consolefonts/ter-112n")))
151 '("tty1" "tty2" "tty3" "tty4" "tty5" "tty6")))
152
153 (service screen-locker-service-type
154 (screen-locker-configuration
155 (name "swaylock")
156 (program (file-append swaylock "/bin/swaylock"))
157 (using-pam? #t)
158 (using-setuid? #f)))
139 159
140 (service network-manager-service-type 160 (service network-manager-service-type
141 (network-manager-configuration 161 (network-manager-configuration
@@ -180,7 +200,17 @@
180 (append (list (plain-file "non-guix.pub" 200 (append (list (plain-file "non-guix.pub"
181 "(public-key (ecc (curve Ed25519) (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))")) 201 "(public-key (ecc (curve Ed25519) (q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))"))
182 %default-authorized-guix-keys)))) 202 %default-authorized-guix-keys))))
183 (delete network-manager-service-type)))) 203 (delete network-manager-service-type)
204 ;; (delete mingetty-service-type)
205 (delete console-font-service-type)
206
207 (delete pulseaudio-service-type)
208 (delete alsa-service-type)
209 (delete (if (string-prefix? "x86_64"
210 (or (%current-target-system)
211 (%current-system)))
212 gdm-service-type
213 sddm-service-type)))))
184 214
185;; Odin is a base for my operating systems 215;; Odin is a base for my operating systems
186(define-public odin-free 216(define-public odin-free
diff --git a/guix/jd/desktops/mimir.scm b/guix/jd/desktops/mimir.scm
index 742f8c5..7d9823d 100644
--- a/guix/jd/desktops/mimir.scm
+++ b/guix/jd/desktops/mimir.scm
@@ -18,17 +18,17 @@
18 18
19 (swap-devices (list (swap-space 19 (swap-devices (list (swap-space
20 (target (uuid 20 (target (uuid
21 "658793cb-d374-426e-bcd5-00d032b003a0"))))) 21 "5402ec34-85b8-4716-9c37-3d38c452ef98")))))
22 22
23 (file-systems (cons* (file-system 23 (file-systems (cons* (file-system
24 (mount-point "/boot/efi") 24 (mount-point "/boot/efi")
25 (device (uuid "64D8-134F" 25 (device (uuid "1A88-DB36"
26 'fat32)) 26 'fat32))
27 (type "vfat")) 27 (type "vfat"))
28 (file-system 28 (file-system
29 (mount-point "/") 29 (mount-point "/")
30 (device (uuid 30 (device (uuid
31 "1f9304b0-5623-4248-ab66-534b5ac85876" 31 "640c44ea-125f-4410-a8de-3ec0fb3656c4"
32 'ext4)) 32 'ext4))
33 (type "ext4")) %base-file-systems)))) 33 (type "ext4")) %base-file-systems))))
34 34
diff --git a/guix/jd/home/services/desktop.scm b/guix/jd/home/services/desktop.scm
index bb4916e..c53377f 100644
--- a/guix/jd/home/services/desktop.scm
+++ b/guix/jd/home/services/desktop.scm
@@ -4,51 +4,165 @@
4 #:use-module (gnu packages networking) 4 #:use-module (gnu packages networking)
5 #:use-module (gnu packages syncthing) 5 #:use-module (gnu packages syncthing)
6 #:use-module (gnu packages gnome) 6 #:use-module (gnu packages gnome)
7 #:use-module (gnu packages gnupg)
7 #:use-module (gnu services) 8 #:use-module (gnu services)
8 #:use-module (gnu services configuration) 9 #:use-module (gnu services configuration)
9 #:use-module (gnu home services) 10 #:use-module (gnu home services)
10 #:use-module (gnu home services shepherd) 11 #:use-module (gnu home services shepherd)
11 #:use-module (gnu home services desktop) 12 #:use-module (gnu home services desktop)
13 #:use-module (gnu home services sound)
14 #:use-module (gnu home services xdg)
15 #:use-module (gnu home services gnupg)
12 #:use-module (guix gexp)) 16 #:use-module (guix gexp))
13 17
14(define (desktop-profile-service config) 18(define (desktop-profile-service config)
15 (specifications->packages '("udiskie" 19 (specifications->packages '(;; sway
20 "swayfx"
21 "swaylock"
22 "swayidle"
23 "waybar"
24 "fuzzel"
25 "foot"
26 "mako"
27 "wl-clipboard"
28 "wlsunset"
29 "grimshot"
30
31 "udiskie"
32 ;; rest
33 "qutebrowser"
34 "ungoogled-chromium"
35 "firefox"
36 "tor-client"
37 "signal-desktop"
38
39 "pulsemixer"
40 "pavucontrol"
41 "alsa-utils"
42
43 "virt-manager"
44
45 "flatpak"
46 "redshift"
47 "fontmanager"
48
49 "polybar"
50
51 "blueman"
52
53 "xdg-utils"
54 "xdg-dbus-proxy"
55 "xdg-desktop-portal-gtk"
56 "xdg-desktop-portal-wlr"
57 "glib:bin"
58 "gtk+:bin"
59 "gnome-keyring"
60 "shared-mime-info"
61 "libnotify"
62 "dconf"
63 "hicolor-icon-theme"
64
65 "dunst"
66
67 "gimp"
68 "inkscape"
69
70 "mpv"
71 "youtube-dl"
72
73 "pamixer"
74 "playerctl"
75 "scrot"
76 "brightnessctl"
77 "upower"
78 "tlp"
79 "feh"
80 "alacritty"
81
82 "curl"
83 "wget"
84 "zip"
85 "unzip"
86 "qrencode"
87 "trash-cli"
88 "pandoc"
89 "password-store"
90 "oath-toolkit"
91 ;; "pinentry"
92
93 "syncthing"
16 "syncthing-gtk" 94 "syncthing-gtk"
17 "network-manager-applet"))) 95
18 96 "xmodmap"
19(define (desktop-shepherd-services config) 97 "xrandr"
20 (list (shepherd-service 98 "arandr"
21 (documentation "Udiskie daemon with tray.") 99 "xss-lock"
22 (provision '(udiskie)) 100 "libinput"
23 (start #~(make-forkexec-constructor 101 "xinput"
24 (list #$(file-append udiskie 102 "xprop"
25 "/bin/udiskie") 103 "rlwrap"
26 "-t"))) 104
27 (stop #~(make-kill-destructor))) 105 "nheko"
28 106 "quassel")))
29 (shepherd-service 107
30 (documentation "Syncthing daemon with tray.") 108(define (desktop-environment-variables-service config)
31 (provision '(syncthing-gtk)) 109 `(("GTK_THEME" . "Adwaita:dark")
32 (start #~(make-forkexec-constructor 110 ("VISUAL" . "emacsclient")
33 (list #$(file-append syncthing-gtk 111 ("EDITOR" . "emacsclient")
34 "/bin/syncthing-gtk") 112 ("PATH" . "$HOME/.bin:$HOME/.npm-global/bin:$PATH")
35 "-m"))) 113 ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share")
36 (stop #~(make-kill-destructor))) 114 ("SBCL_HOME" . "/run/current-system/profile/lib/sbcl/")
37 115
38 (shepherd-service 116 ;; Set Wayland-specific environment variables (taken from RDE)
39 (documentation "NetworkManager tray.") 117 ("XDG_CURRENT_DESKTOP" . "sway")
40 (provision '(nm-applet)) 118 ("XDG_SESSION_TYPE" . "wayland")
41 (start #~(make-forkexec-constructor 119 ("RTC_USE_PIPEWIRE" . "true")
42 (list #$(file-append network-manager-applet 120 ("SDL_VIDEODRIVER" . "wayland")
43 "/bin/nm-applet")))) 121 ("MOZ_ENABLE_WAYLAND" . "1")
44 (stop #~(make-kill-destructor))))) 122 ("CLUTTER_BACKEND" . "wayland")
123 ("ELM_ENGINE" . "wayland_egl")
124 ("ECORE_EVAS_ENGINE" . "wayland-egl")
125 ("QT_QPA_PLATFORM" . "wayland-egl")))
126
127(define (desktop-xdg-mime-applications-service config)
128 (home-xdg-mime-applications-configuration
129 (default '((inode/directory . emacsclient.desktop)
130 (application/pdf . emacsclient.desktop)
131 (x-scheme-handler/http= . firefox.desktop)
132 (x-scheme-handler/https= . firefox.desktop)))
133 ;; (desktop-entries
134 ;; (list (xdg-desktop-entry
135 ;; (file "emacs-desktop")
136 ;; (name "Emacs")
137 ;; (type 'application)
138 ;; (config
139 ;; '((exec . "emacsclient -a emacs %u"))))))
140 ))
141
142(define (desktop-gpg-agent-service config)
143 (home-gpg-agent-configuration
144 (pinentry-program
145 (file-append pinentry-gnome3 "/bin/pinentry-gnome3"))
146 (ssh-support? #t)
147 (default-cache-ttl 28800)
148 (max-cache-ttl 28800)
149 (default-cache-ttl-ssh 28800)
150 (max-cache-ttl-ssh 28800)))
151
45 152
46(define-public home-desktop-service-type 153(define-public home-desktop-service-type
47 (service-type (name 'home-udiskie) 154 (service-type (name 'home-desktop)
48 (extensions (list (service-extension home-profile-service-type 155 (extensions (list (service-extension home-profile-service-type
49 desktop-profile-service) 156 desktop-profile-service)
50 (service-extension home-shepherd-service-type 157 (service-extension home-environment-variables-service-type
51 desktop-shepherd-services))) 158 desktop-environment-variables-service)
159 (service-extension home-pipewire-service-type
160 (lambda (_) (home-pipewire-configuration)))
161 (service-extension home-xdg-mime-applications-service-type
162 desktop-xdg-mime-applications-service)
163 (service-extension home-gpg-agent-service-type
164 desktop-gpg-agent-service)
165 ))
52 (default-value #f) 166 (default-value #f)
53 (description "Runs desktop services."))) 167 (description "Runs desktop services.")))
54 168
diff --git a/guix/jd/home/services/emacs.scm b/guix/jd/home/services/emacs.scm
new file mode 100644
index 0000000..5eb74e8
--- /dev/null
+++ b/guix/jd/home/services/emacs.scm
@@ -0,0 +1,112 @@
1(define-module (jd home services emacs)
2 #:use-module (jd packages emacs)
3
4 #:use-module (gnu packages)
5 #:use-module (gnu packages emacs)
6
7 #:use-module (gnu services)
8 #:use-module (gnu services configuration)
9 #:use-module (gnu home services)
10 #:use-module (gnu home services shepherd)
11 #:use-module (gnu home services desktop)
12
13 #:use-module (guix gexp)
14 #:use-module (guix packages)
15 #:use-module (guix profiles))
16
17(define-configuration home-emacs-service-configuration
18 (emacs-package
19 (package emacs-next-pgtk)
20 "Emacs packages"))
21
22(define (emacs-profile-service config)
23 (append (list emacs-org-roam-ui
24 emacs-lsp-mode!
25 (home-emacs-service-configuration-emacs-package
26 config))
27 (specifications->packages '("emacs-sway"
28 "emacs-shackle"
29 "emacs-ytdl"
30 "emacs-desktop-environment"
31 "emacs-exwm"
32 "emacs-perspective"
33 "emacs-mu4e-alert"
34 "mu"
35 "isync"
36 "emacs-htmlize"
37 "emacs-bluetooth"
38 "emacs-nov-el"
39 "emacs-password-store"
40 "emacs-mastodon"
41 "emacs-elfeed"
42 "emacs-pdf-tools"
43 "emacs-emms"
44 "emacs-all-the-icons-dired"
45 "emacs-vterm"
46 "emacs-restclient"
47 "emacs-magit"
48 "emacs-neotree"
49 "emacs-projectile"
50 "emacs-company-box"
51 "emacs-company"
52 "emacs-docker"
53 "emacs-yaml-mode"
54 "emacs-web-mode"
55 "emacs-flycheck"
56 "emacs-tide"
57 "emacs-cider"
58 "emacs-typescript-mode"
59 "emacs-pyvenv"
60 "emacs-geiser-guile"
61 "emacs-racket-mode"
62 "emacs-geiser-racket"
63 "emacs-geiser"
64 "emacs-sly"
65 "emacs-rainbow-delimiters"
66 "emacs-paredit"
67 ;; "emacs-lsp-ivy"
68 ;; "emacs-lsp-mode"
69 "emacs-org-pomodoro"
70 "emacs-org-roam"
71 "emacs-org-roam-bibtex"
72 "emacs-org-superstar"
73 "emacs-org"
74 "emacs-ox-pandoc"
75 "emacs-beacon"
76 "emacs-all-the-icons"
77 "emacs-which-key"
78 "emacs-counsel"
79 "emacs-ivy"
80 "emacs-hl-todo"
81 "emacs-diminish"
82 "emacs-solarized-theme"
83 "font-terminus"
84 "emacs-undo-tree"
85 "emacs-hydra"
86 "emacs-multiple-cursors"
87 "emacs-general"
88 "emacs-guix"
89 "emacs-doom-modeline"
90 "emacs-use-package"))))
91
92(define (emacs-shepherd-services config)
93 (list (shepherd-service
94 (documentation "Emacs daemon.")
95 (provision '(emacs))
96 (start #~(make-forkexec-constructor
97 (list #$(file-append (home-emacs-service-configuration-emacs-package
98 config)
99 "/bin/emacs")
100 "--fg-daemon")))
101 (stop #~(make-kill-destructor)))))
102
103(define-public home-emacs-service-type
104 (service-type (name 'home-emacs)
105 (extensions (list (service-extension home-profile-service-type
106 emacs-profile-service)
107 (service-extension home-shepherd-service-type
108 emacs-shepherd-services)
109 ))
110 (default-value (home-emacs-service-configuration))
111 (description "Runs emacs daemon service.")))
112
diff --git a/guix/jd/packages/emacs.scm b/guix/jd/packages/emacs.scm
new file mode 100644
index 0000000..0b9b19d
--- /dev/null
+++ b/guix/jd/packages/emacs.scm
@@ -0,0 +1,57 @@
1(define-module (jd packages emacs)
2 #:use-module (gnu packages emacs-xyz)
3 #:use-module (gnu packages)
4 #:use-module (guix packages)
5 #:use-module (guix git-download)
6 #:use-module (guix build-system emacs)
7 #:use-module ((guix licenses) #:prefix license:)
8 #:export (emacs-org-roam-ui
9 emacs-lsp-mode!))
10
11
12(define emacs-org-roam-ui
13 (let ((commit "9474a254390b1e42488a1801fed5826b32a8030b")
14 (revision "0"))
15 (package
16 (name "emacs-org-roam-ui")
17 (version (git-version "0" revision commit))
18 (source (origin
19 (method git-fetch)
20 (uri (git-reference
21 (url "https://github.com/org-roam/org-roam-ui")
22 (commit commit)))
23 (file-name (git-file-name name version))
24 (sha256
25 (base32
26 "0v54vxh95izch74wz2dl2dkdqicbvshra55l6qvd4xl5qmfhpjdc"))))
27 (build-system emacs-build-system)
28 (arguments
29 `(#:include (cons "^out" %default-include)))
30 (propagated-inputs
31 (list emacs-org-roam emacs-websocket emacs-simple-httpd emacs-f))
32 (home-page "https://github.com/org-roam/org-roam-ui")
33 (synopsis "A graphical frontend for your org-roam Zettelkasten")
34 (description " Org-Roam-UI is a frontend for exploring and interacting
35with your @code{org-roam} notes. It is meant a successor of
36@code{org-roam-server} that extends functionality of org-roam with a Web app
37that runs side-by-side with Emacs.")
38 (license license:gpl3+))))
39
40
41
42(define emacs-lsp-mode!
43 (let ((commit "808c4d0ab9f19bb92c56716cf59df89432b63f5d")
44 (revision "1"))
45 (package
46 (inherit emacs-lsp-mode)
47 (name "emacs-lsp-mode")
48 (version (git-version "8.0.1" revision commit))
49 (source
50 (origin
51 (method git-fetch)
52 (uri (git-reference
53 (url "https://github.com/emacs-lsp/lsp-mode")
54 (commit commit)))
55 (file-name (git-file-name name version))
56 (sha256
57 (base32 "0ridjhzndwjj8947vabq05njgnns74hi69x77axgcbv1c4nasz2y")))))))
diff --git a/guix/jd/utils.scm b/guix/jd/utils.scm
index 5be7fa9..f4a35c1 100644
--- a/guix/jd/utils.scm
+++ b/guix/jd/utils.scm
@@ -3,15 +3,24 @@
3 3
4;; This code is copied and modified from (gnu packages) module. 4;; This code is copied and modified from (gnu packages) module.
5 5
6(define %jd-patch-path 6(define (make-custom-load-path dir-path)
7 (make-parameter 7 (make-parameter
8 (map (lambda (directory) 8 (map (lambda (directory)
9 (let ((jd-patch-dir (string-append directory "/jd/packages/patches"))) 9 (let ((custom-dir (string-append directory dir-path)))
10 (if (and (file-exists? jd-patch-dir) 10 (if (and (file-exists? custom-dir)
11 (file-is-directory? jd-patch-dir)) 11 (file-is-directory? custom-dir))
12 jd-patch-dir 12 custom-dir
13 directory))) 13 directory)))
14 %load-path))) 14 %load-path)))
15
16(define (make-custom-searcher load-path)
17 (lambda (file-name)
18 (or (search-path (load-path) file-name)
19 (raise (string-append file-name
20 ": not found")))))
21
22(define %jd-patch-path (make-custom-load-path "/jd/packages/patches"))
23(define %jd-dot-files-path (make-custom-load-path "/jd/home/services/dotfiles"))
15 24
16(define (jd-search-patch file-name) 25(define (jd-search-patch file-name)
17 "Search the patch FILE-NAME. Raise an error if not found." 26 "Search the patch FILE-NAME. Raise an error if not found."