summaryrefslogtreecommitdiffstats
path: root/guix/jd/home/services
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 /guix/jd/home/services
parent9ca1ae3ceca5944765af94514e75a96195de5716 (diff)
downloaddotfiles-73af89d935df5a8166114c9257f9f247f29850bf.tar.gz
dotfiles-73af89d935df5a8166114c9257f9f247f29850bf.zip
Migrate from stumpwm to sway and from manifests to home-services.
Diffstat (limited to 'guix/jd/home/services')
-rw-r--r--guix/jd/home/services/desktop.scm178
-rw-r--r--guix/jd/home/services/emacs.scm112
2 files changed, 258 insertions, 32 deletions
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