Compare commits

...

5 Commits

Author SHA1 Message Date
Hilton Chain
1f7b63ae66
services: Add %rosenthal-skeletons.
* modules/rosenthal/services/desktop.scm (%rosenthal-skeletons): New variable.
(%rosenthal-example-emacs-init): Delete variable.
* modules/rosenthal/examples: Update examples.
2025-06-26 22:56:56 +08:00
Hilton Chain
911bb32f41
services: %rosenthal-desktop-home-services: Remove skeletons.
* modules/rosenthal/services/desktop.scm (%rosenthal-desktop-home-services):
Remove skeletons.
2025-06-26 22:53:59 +08:00
Hilton Chain
7a185369e9
services: desktop: Use ‘define-configuration’. 2025-06-26 22:53:59 +08:00
Hilton Chain
20bac9c7a4
services: shellutils: Add missing module.
* modules/rosenthal/services/shellutils.scm: Add (rosenthal utils packages)
module.
2025-06-26 22:53:59 +08:00
Hilton Chain
72f327054a
services: rosenthal-desktop-services-for-system: Add gvfs-service-type.
* modules/rosenthal/services/desktop.scm: Add gvfs-service-type.
2025-06-26 22:53:59 +08:00
5 changed files with 177 additions and 251 deletions

View File

@ -8,7 +8,7 @@
(make-empty-file custom-file) (make-empty-file custom-file)
(load custom-file)) (load custom-file))
(let ((font-config "$$fonts.el$$")) (let ((font-config (locate-user-emacs-file "fonts.el")))
(when (file-exists-p font-config) (when (file-exists-p font-config)
(load-file font-config))) (load-file font-config)))
@ -197,9 +197,8 @@
(use-package geiser (use-package geiser
:custom :custom
(geiser-autodoc-identifier-format "%s → %s") (geiser-autodoc-identifier-format "%s → %s")
(geiser-default-implementation 'guile)
(geiser-active-implementation '(guile))
(geiser-mode-smart-tab-p t) (geiser-mode-smart-tab-p t)
(geiser-mode-start-repl-p t)
(geiser-repl-query-on-kill-p nil) (geiser-repl-query-on-kill-p nil)
:init :init
;; Context menu on right click. ;; Context menu on right click.
@ -207,10 +206,6 @@
(defun context-menu () (defun context-menu ()
(let ((menu (make-sparse-keymap))) (let ((menu (make-sparse-keymap)))
(pcase major-mode (pcase major-mode
('geiser-repl-mode
(define-key menu (vector 'insert-image)
'("Insert image" . geiser--guile-picture-language--pict-from-file))
menu)
('scheme-mode ('scheme-mode
(define-key menu (vector 'switch-to-repl) (define-key menu (vector 'switch-to-repl)
'("Switch to REPL" . geiser-repl-switch)) '("Switch to REPL" . geiser-repl-switch))
@ -230,6 +225,9 @@
;;guix:emacs-geiser-guile ;;guix:emacs-geiser-guile
(use-package geiser-guile (use-package geiser-guile
:after (geiser) :after (geiser)
:custom
(geiser-active-implementation '(guile))
(geiser-default-implementation 'guile)
:config :config
;; TODO: Make `flycheck-guile' support `guix repl'. ;; TODO: Make `flycheck-guile' support `guix repl'.
(dolist (path (dolist (path
@ -310,7 +308,6 @@
(setopt initial-scratch-message (setopt initial-scratch-message
";;; Type your Guile program here and evaluate it.\n\n") ";;; Type your Guile program here and evaluate it.\n\n")
(scheme-mode) (scheme-mode)
(geiser-repl-switch)
(geiser-repl-import-module "(rosenthal)") (geiser-repl-import-module "(rosenthal)")
(geiser-repl-import-module "(nonguix transformations)") (geiser-repl-import-module "(nonguix transformations)")
(delete-window) (delete-window)

View File

@ -338,8 +338,8 @@ binds {
Mod+Shift+Slash { show-hotkey-overlay; } Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker. // Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T { spawn "$$bin/alacritty$$"; } Mod+T { spawn "foot"; }
Mod+D { spawn "$$bin/rofi$$" "-show" "drun"; } Mod+D { spawn "rofi" "-show" "drun"; }
// Super+Alt+L { spawn "swaylock"; } // Super+Alt+L { spawn "swaylock"; }
// You can also use a shell. Do this if you need pipes, multiple commands, etc. // You can also use a shell. Do this if you need pipes, multiple commands, etc.
@ -348,14 +348,14 @@ binds {
// Example volume keys mappings for PipeWire & WirePlumber. // Example volume keys mappings for PipeWire & WirePlumber.
// The allow-when-locked=true property makes them work even when the session is locked. // The allow-when-locked=true property makes them work even when the session is locked.
XF86AudioRaiseVolume allow-when-locked=true { spawn "$$bin/wpctl$$" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; } XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "$$bin/wpctl$$" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; } XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
XF86AudioMute allow-when-locked=true { spawn "$$bin/wpctl$$" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; } XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "$$bin/wpctl$$" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; } XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
// Example brightness key mappings for light. // Example brightness key mappings for light.
XF86MonBrightnessUp allow-when-locked=true { spawn "$$bin/light$$" "-A" "10"; } XF86MonBrightnessUp allow-when-locked=true { spawn "light" "-A" "10"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "$$bin/light$$" "-U" "10"; } XF86MonBrightnessDown allow-when-locked=true { spawn "light" "-U" "10"; }
Mod+Q { close-window; } Mod+Q { close-window; }
@ -578,7 +578,7 @@ binds {
prefer-no-csd prefer-no-csd
spawn-at-startup "sh" "-c" "pgrep --uid $USER shepherd > /dev/null || shepherd" spawn-at-startup "sh" "-c" "pgrep --uid $USER shepherd > /dev/null || shepherd"
spawn-at-startup "$$bin/xwayland-satellite$$" ":233" spawn-at-startup "xwayland-satellite" ":233"
environment { environment {
DISPLAY ":233" DISPLAY ":233"
} }

View File

@ -85,12 +85,12 @@
"format": "{icon} {volume}%", "format": "{icon} {volume}%",
"format-icons": ["\uF026", "\uF027", "\uF028"], "format-icons": ["\uF026", "\uF027", "\uF028"],
"format-muted": "Muted {volume}%", "format-muted": "Muted {volume}%",
"on-click": "$$bin/wpctl$$ set-mute @DEFAULT_AUDIO_SINK@ toggle", "on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
"on-click-right": "$$bin/pavucontrol$$", "on-click-right": "pavucontrol",
}, },
"backlight": { "backlight": {
"on-scroll-down": "$$bin/light$$ -U 5", "on-scroll-down": "light -U 5",
"on-scroll-up": "$$bin/light$$ -A 5", "on-scroll-up": "light -A 5",
"format": "{icon} {percent}%", "format": "{icon} {percent}%",
"format-icons": ["\uF186", "\uF0EB"], "format-icons": ["\uF186", "\uF0EB"],
"tooltip": false, "tooltip": false,

View File

@ -14,6 +14,7 @@
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services base) #:use-module (gnu services base)
#:use-module (gnu services configuration)
#:use-module (gnu services desktop) #:use-module (gnu services desktop)
#:use-module (gnu services sddm) #:use-module (gnu services sddm)
#:use-module (gnu services xorg) #:use-module (gnu services xorg)
@ -27,9 +28,7 @@
#:use-module (rosenthal packages xorg) #:use-module (rosenthal packages xorg)
#:export (%rosenthal-example-emacs-init #:export (home-blueman-applet-configuration
home-blueman-applet-configuration
home-blueman-applet-service-type home-blueman-applet-service-type
home-fcitx5-configuration home-fcitx5-configuration
@ -56,33 +55,21 @@
home-waybar-configuration home-waybar-configuration
home-waybar-service-type home-waybar-service-type
%rosenthal-skeletons
%rosenthal-desktop-services %rosenthal-desktop-services
%rosenthal-desktop-home-services)) %rosenthal-desktop-home-services))
;;;
;;; Configuration file presets.
;;;
(define %rosenthal-example-emacs-init
(computed-substitution-with-inputs "init.el"
(local-file "../examples/emacs/init.el")
(list (local-file "../examples/emacs" #:recursive? #t))))
;;; ;;;
;;; Blueman ;;; Blueman
;;; ;;;
(define-record-type* <home-blueman-applet-configuration> (define-configuration/no-serialization home-blueman-applet-configuration
home-blueman-applet-configuration (blueman
make-home-blueman-applet-configuration (file-like (spec->pkg+out "blueman"))
home-blueman-applet-configuration? ""))
this-home-blueman-applet-configuration
(blueman home-blueman-applet-configuration-blueman
(default (spec->pkg+out "blueman"))))
(define home-blueman-applet-shepherd-service (define %home-blueman-applet-shepherd
(match-record-lambda <home-blueman-applet-configuration> (match-record-lambda <home-blueman-applet-configuration>
(blueman) (blueman)
(list (shepherd-service (list (shepherd-service
@ -100,7 +87,7 @@
(list (service-extension home-profile-service-type (list (service-extension home-profile-service-type
(compose list home-blueman-applet-configuration-blueman)) (compose list home-blueman-applet-configuration-blueman))
(service-extension home-shepherd-service-type (service-extension home-shepherd-service-type
home-blueman-applet-shepherd-service))) %home-blueman-applet-shepherd)))
(default-value (home-blueman-applet-configuration)) (default-value (home-blueman-applet-configuration))
(description "Run blueman applet, a tray applet for managing bluetooth."))) (description "Run blueman applet, a tray applet for managing bluetooth.")))
@ -109,38 +96,32 @@
;;; Fcitx5 ;;; Fcitx5
;;; ;;;
(define-record-type* <home-fcitx5-configuration> (define list-of-file-likes?
home-fcitx5-configuration (list-of file-like?))
make-home-fcitx5-configuration (define-maybe file-like)
home-fcitx5-configuration?
this-home-fcitx5-configuration (define-configuration/no-serialization home-fcitx5-configuration
(fcitx5 home-fcitx5-configuration-fcitx5 (fcitx5
(default (spec->pkg "fcitx5"))) (file-like (spec->pkg "fcitx5"))
(utilities home-fcitx5-configuration-utilities "")
(default (specs->pkgs "fcitx5-configtool"))) (utilities
(themes home-fcitx5-configuration-themes (list-of-file-likes (specs->pkgs "fcitx5-configtool"))
(default '())) "")
(input-method-editors home-fcitx5-configuration-input-method-editors (themes
(default '())) (list-of-file-likes '())
(gtk-im-module? home-fcitx5-configuration-gtk-im-module? "")
(default #f)) (input-method-editors
(qt-im-module? home-fcitx5-configuration-qt-im-module? (list-of-file-likes '())
(default #f)) "")
(xim? home-fcitx5-configuration-xim? (gtk-im-module?
(default #t)) (boolean #f)
;; Extensions "")
(environment-variables home-fcitx5-configuration-environment-variables (qt-im-module?
(default (%home-fcitx5-environment-variables (boolean #f)
this-home-fcitx5-configuration)) "")
(thunked)) (xim?
(profile home-fcitx5-configuration-profile (boolean #t)
(default (%home-fcitx5-profile ""))
this-home-fcitx5-configuration))
(thunked))
(shepherd home-fcitx5-configuration-shepherd
(default (%home-fcitx5-shepherd
this-home-fcitx5-configuration))
(thunked)))
(define %home-fcitx5-environment-variables (define %home-fcitx5-environment-variables
(match-record-lambda <home-fcitx5-configuration> (match-record-lambda <home-fcitx5-configuration>
@ -186,11 +167,11 @@
(name 'fcitx5) (name 'fcitx5)
(extensions (extensions
(list (service-extension home-environment-variables-service-type (list (service-extension home-environment-variables-service-type
home-fcitx5-configuration-environment-variables) %home-fcitx5-environment-variables)
(service-extension home-profile-service-type (service-extension home-profile-service-type
home-fcitx5-configuration-profile) %home-fcitx5-profile)
(service-extension home-shepherd-service-type (service-extension home-shepherd-service-type
home-fcitx5-configuration-shepherd))) %home-fcitx5-shepherd)))
(default-value (home-fcitx5-configuration)) (default-value (home-fcitx5-configuration))
(description "Run fcitx5, an input method framework."))) (description "Run fcitx5, an input method framework.")))
@ -199,32 +180,21 @@
;;; mako ;;; mako
;;; ;;;
(define %rosenthal-example-mako-config (define-configuration/no-serialization home-mako-configuration
(local-file "../examples/mako.conf")) (mako
(file-like (spec->pkg "mako"))
(define-record-type* <home-mako-configuration> "")
home-mako-configuration (config
make-home-mako-configuration maybe-file-like
home-mako-configuration? "")
this-home-mako-configuration )
(mako home-mako-configuration-mako
(default (spec->pkg "mako")))
(config home-mako-configuration-config
(default %rosenthal-example-mako-config))
;; Extensions.
(xdg-config home-mako-configuration-xdg-config
(default (%home-mako-xdg-config
this-home-mako-configuration))
(thunked))
(shepherd home-mako-configuration-shepherd
(default (%home-mako-shepherd
this-home-mako-configuration))
(thunked)))
(define %home-mako-xdg-config (define %home-mako-xdg-config
(match-record-lambda <home-mako-configuration> (match-record-lambda <home-mako-configuration>
(config) (config)
`(("mako/config" ,config)))) (if (maybe-value-set? config)
`(("mako/config" ,config))
'())))
(define %home-mako-shepherd (define %home-mako-shepherd
(match-record-lambda <home-mako-configuration> (match-record-lambda <home-mako-configuration>
@ -242,9 +212,9 @@
(name 'mako) (name 'mako)
(extensions (extensions
(list (service-extension home-xdg-configuration-files-service-type (list (service-extension home-xdg-configuration-files-service-type
home-mako-configuration-xdg-config) %home-mako-xdg-config)
(service-extension home-shepherd-service-type (service-extension home-shepherd-service-type
home-mako-configuration-shepherd))) %home-mako-shepherd)))
(default-value (home-mako-configuration)) (default-value (home-mako-configuration))
(description "Run mako, a notification daemon."))) (description "Run mako, a notification daemon.")))
@ -253,15 +223,12 @@
;;; network-manager-applet ;;; network-manager-applet
;;; ;;;
(define-record-type* <home-network-manager-applet-configuration> (define-configuration/no-serialization home-network-manager-applet-configuration
home-network-manager-applet-configuration (network-manager-applet
make-home-network-manager-applet-configuration (file-like (spec->pkg "network-manager-applet"))
home-network-manager-applet-configuration? ""))
this-home-network-manager-applet-configuration
(network-manager-applet home-network-manager-applet-configuration-network-manager-applet
(default (spec->pkg "network-manager-applet"))))
(define home-network-manager-applet-shepherd-service (define %home-network-manager-applet-shepherd
(match-record-lambda <home-network-manager-applet-configuration> (match-record-lambda <home-network-manager-applet-configuration>
(network-manager-applet) (network-manager-applet)
(list (shepherd-service (list (shepherd-service
@ -279,7 +246,7 @@
(list (service-extension home-profile-service-type (list (service-extension home-profile-service-type
(compose list home-network-manager-applet-configuration-network-manager-applet)) (compose list home-network-manager-applet-configuration-network-manager-applet))
(service-extension home-shepherd-service-type (service-extension home-shepherd-service-type
home-network-manager-applet-shepherd-service))) %home-network-manager-applet-shepherd)))
(default-value (home-network-manager-applet-configuration)) (default-value (home-network-manager-applet-configuration))
(description "Run nm-applet, a tray applet for managing networks."))) (description "Run nm-applet, a tray applet for managing networks.")))
@ -288,40 +255,24 @@
;;; niri ;;; niri
;;; ;;;
(define %rosenthal-example-niri-config (define-configuration/no-serialization home-niri-configuration
(computed-substitution-with-inputs "niri.kdl" (config
(local-file "../examples/niri.kdl") maybe-file-like
(cons xwayland-satellite ""))
(specs->pkgs "alacritty"
"guix-backgrounds"
"light"
"rofi-wayland"
"wireplumber"))))
(define-record-type* <home-niri-configuration>
home-niri-configuration
make-home-niri-configuration
home-niri-configuration?
this-home-niri-configuration
(config home-niri-configuration-config
(default %rosenthal-example-niri-config))
;; Extension.
(xdg-config home-niri-configuration-xdg-config
(default (%home-niri-xdg-config
this-home-niri-configuration))
(thunked)))
(define %home-niri-xdg-config (define %home-niri-xdg-config
(match-record-lambda <home-niri-configuration> (match-record-lambda <home-niri-configuration>
(config) (config)
`(("niri/config.kdl" ,config)))) (if (maybe-value-set? config)
`(("niri/config.kdl" ,config))
'())))
(define home-niri-service-type (define home-niri-service-type
(service-type (service-type
(name 'niri) (name 'niri)
(extensions (extensions
(list (service-extension home-xdg-configuration-files-service-type (list (service-extension home-xdg-configuration-files-service-type
home-niri-configuration-xdg-config))) %home-niri-xdg-config)))
(default-value (home-niri-configuration)) (default-value (home-niri-configuration))
(description (description
"Set up configuration file for niri, a scrollable-tiling Wayland "Set up configuration file for niri, a scrollable-tiling Wayland
@ -332,38 +283,24 @@ compositor.")))
;;; rofi ;;; rofi
;;; ;;;
(define %rosenthal-example-rofi-config (define-configuration/no-serialization home-rofi-configuration
(mixed-text-file "rofi.rasi" "\ (config
configuration { maybe-file-like
icon-theme: \"Qogir\"; ""))
}
@theme \"" (spec->pkg "rofi-wayland") "/share/rofi/themes/fullscreen-preview.rasi\"\n"))
(define-record-type* <home-rofi-configuration>
home-rofi-configuration
make-home-rofi-configuration
home-rofi-configuration?
this-home-rofi-configuration
(config home-rofi-configuration-config
(default %rosenthal-example-rofi-config))
;; Extension.
(xdg-config home-rofi-configuration-xdg-config
(default (%home-rofi-xdg-config
this-home-rofi-configuration))
(thunked)))
(define %home-rofi-xdg-config (define %home-rofi-xdg-config
(match-record-lambda <home-rofi-configuration> (match-record-lambda <home-rofi-configuration>
(config) (config)
`(("rofi/config.rasi" ,config)))) (if (maybe-value-set? config)
`(("rofi/config.rasi" ,config))
'())))
(define home-rofi-service-type (define home-rofi-service-type
(service-type (service-type
(name 'rofi) (name 'rofi)
(extensions (extensions
(list (service-extension home-xdg-configuration-files-service-type (list (service-extension home-xdg-configuration-files-service-type
home-rofi-configuration-xdg-config))) %home-rofi-xdg-config)))
(default-value (home-rofi-configuration)) (default-value (home-rofi-configuration))
(description (description
"Set up configuration file for rofi, an application launcher."))) "Set up configuration file for rofi, an application launcher.")))
@ -373,20 +310,13 @@ configuration {
;;; swaybg ;;; swaybg
;;; ;;;
(define-record-type* <home-swaybg-configuration> (define-configuration/no-serialization home-swaybg-configuration
home-swaybg-configuration (swaybg
make-home-swaybg-configuration (file-like (spec->pkg "swaybg"))
home-swaybg-configuration? "")
this-home-swaybg-configuration (background
(swaybg home-swaybg-configuration-swaybg (file-like (local-file "../examples/wallpaper.jpg"))
(default (spec->pkg "swaybg"))) ""))
(background home-swaybg-configuration-background
(default (local-file "../examples/wallpaper.jpg")))
;; Extensions.
(shepherd home-swaybg-configuration-shepherd
(default (%home-swaybg-shepherd
this-home-swaybg-configuration))
(thunked)))
(define %home-swaybg-shepherd (define %home-swaybg-shepherd
(match-record-lambda <home-swaybg-configuration> (match-record-lambda <home-swaybg-configuration>
@ -405,7 +335,7 @@ configuration {
(name 'swaybg) (name 'swaybg)
(extensions (extensions
(list (service-extension home-shepherd-service-type (list (service-extension home-shepherd-service-type
home-swaybg-configuration-shepherd))) %home-swaybg-shepherd)))
(default-value (home-swaybg-configuration)) (default-value (home-swaybg-configuration))
(description (description
"Run swaybg, a screen wallpaper utility for Wayland compositors."))) "Run swaybg, a screen wallpaper utility for Wayland compositors.")))
@ -415,38 +345,22 @@ configuration {
;;; theme ;;; theme
;;; ;;;
(define-record-type* <home-theme-configuration> (define-configuration/no-serialization home-theme-configuration
home-theme-configuration (packages
make-home-theme-configuration (list-of-file-likes '())
home-theme-configuration? "")
this-home-theme-configuration (icon-theme
(packages home-theme-configuration-packages (string "Adwaita")
(default '())) "")
(icon-theme home-theme-configuration-icon-theme (cursor-theme
(default "Adwaita")) (string "Adwaita")
(cursor-theme home-theme-configuration-cursor-theme "")
(default "Adwaita")) (cursor-size
(cursor-size home-theme-configuration-cursor-size (number 24)
(default 24)) "")
(key-theme home-theme-configuration-key-theme (key-theme
(default "Default")) (string "Default")
;; Extensions. ""))
(environment-variables home-theme-configuration-environment-variables
(default (%home-theme-environment-variables
this-home-theme-configuration))
(thunked))
(profile home-theme-configuration-profile
(default (%home-theme-profile
this-home-theme-configuration))
(thunked))
(files home-theme-configuration-files
(default (%home-theme-files
this-home-theme-configuration))
(thunked))
(xdg-config home-theme-configuration-xdg-config
(default (%home-theme-xdg-config
this-home-theme-configuration))
(thunked)))
(define (%home-theme-environment-variables _) (define (%home-theme-environment-variables _)
'(("QT_QPA_PLATFORMTHEME" . "gtk3") '(("QT_QPA_PLATFORMTHEME" . "gtk3")
@ -465,7 +379,7 @@ configuration {
(icon-theme) (icon-theme)
`((".icons/default/index.theme" `((".icons/default/index.theme"
,(plain-file "index.theme" ,(plain-file "index.theme"
(format #f "~ (format #f "\
[icon theme] [icon theme]
Inherits = ~a~%" Inherits = ~a~%"
icon-theme)))))) icon-theme))))))
@ -475,7 +389,7 @@ Inherits = ~a~%"
(icon-theme cursor-theme cursor-size key-theme) (icon-theme cursor-theme cursor-size key-theme)
`(("gtk-3.0/settings.ini" `(("gtk-3.0/settings.ini"
,(plain-file "settings.ini" ,(plain-file "settings.ini"
(format #f "~ (format #f "\
[Settings] [Settings]
gtk-theme-name = Adwaita gtk-theme-name = Adwaita
gtk-icon-theme-name = ~a gtk-icon-theme-name = ~a
@ -490,13 +404,13 @@ gtk-key-theme-name = ~a~%"
(name 'theme) (name 'theme)
(extensions (extensions
(list (service-extension home-environment-variables-service-type (list (service-extension home-environment-variables-service-type
home-theme-configuration-environment-variables) %home-theme-environment-variables)
(service-extension home-profile-service-type (service-extension home-profile-service-type
home-theme-configuration-profile) %home-theme-profile)
(service-extension home-files-service-type (service-extension home-files-service-type
home-theme-configuration-files) %home-theme-files)
(service-extension home-xdg-configuration-files-service-type (service-extension home-xdg-configuration-files-service-type
home-theme-configuration-xdg-config))) %home-theme-xdg-config)))
(default-value (home-theme-configuration)) (default-value (home-theme-configuration))
(description "Set up desktop themes."))) (description "Set up desktop themes.")))
@ -505,40 +419,26 @@ gtk-key-theme-name = ~a~%"
;;; waybar ;;; waybar
;;; ;;;
(define %rosenthal-example-waybar-config (define-configuration/no-serialization home-waybar-configuration
(computed-substitution-with-inputs "config.jsonc" (waybar
(local-file "../examples/waybar/config.jsonc") (file-like (spec->pkg "waybar"))
(specs->pkgs "light" "pavucontrol" "wireplumber"))) "")
(config
(define %rosenthal-example-waybar-style maybe-file-like
(local-file "../examples/waybar/style.css")) "")
(style
(define-record-type* <home-waybar-configuration> maybe-file-like
home-waybar-configuration ""))
make-home-waybar-configuration
home-waybar-configuration?
this-home-waybar-configuration
(waybar home-waybar-configuration-waybar
(default (spec->pkg "waybar")))
(config home-waybar-configuration-config
(default %rosenthal-example-waybar-config))
(style home-waybar-configuration-style
(default %rosenthal-example-waybar-style))
;; Extensions.
(xdg-config home-waybar-configuration-xdg-config
(default (%home-waybar-xdg-config
this-home-waybar-configuration))
(thunked))
(shepherd home-waybar-configuration-shepherd
(default (%home-waybar-shepherd
this-home-waybar-configuration))
(thunked)))
(define %home-waybar-xdg-config (define %home-waybar-xdg-config
(match-record-lambda <home-waybar-configuration> (match-record-lambda <home-waybar-configuration>
(config style) (config style)
`(("waybar/config.jsonc" ,config) `(,@(if (maybe-value-set? config)
("waybar/style.css" ,style)))) `(("waybar/config.jsonc" ,config))
'())
,@(if (maybe-value-set? style)
`(("waybar/style.css" ,style))
'()))))
(define %home-waybar-shepherd (define %home-waybar-shepherd
(match-record-lambda <home-waybar-configuration> (match-record-lambda <home-waybar-configuration>
@ -556,12 +456,46 @@ gtk-key-theme-name = ~a~%"
(name 'waybar) (name 'waybar)
(extensions (extensions
(list (service-extension home-xdg-configuration-files-service-type (list (service-extension home-xdg-configuration-files-service-type
home-waybar-configuration-xdg-config) %home-waybar-xdg-config)
(service-extension home-shepherd-service-type (service-extension home-shepherd-service-type
home-waybar-configuration-shepherd))) %home-waybar-shepherd)))
(default-value (home-waybar-configuration)) (default-value (home-waybar-configuration))
(description "Run waybar, a status bar for Wayland compositors."))) (description "Run waybar, a status bar for Wayland compositors.")))
;;;
;;; Configuration file presets.
;;;
(define %rosenthal-skeletons
`((".config/emacs/fonts.el"
,(local-file "../examples/emacs/fonts.el"))
(".config/emacs/init.el"
,(local-file "../examples/emacs/init.el"))
(".config/foot/foot.ini"
,(plain-file "foot.ini" "font=monospace:size=12\n"))
(".config/mako/config"
,(local-file "../examples/mako.conf"))
(".config/niri/config.kdl"
,(local-file "../examples/niri.kdl"))
(".config/rofi/config.rasi"
,(plain-file "rofi.rasi" "\
configuration {
icon-theme: \"Qogir\";
}
@theme \"/run/current-system/profile/share/rofi/themes/fullscreen-preview.rasi\"\n"))
(".config/waybar/config.jsonc"
,(local-file "../examples/waybar/config.jsonc"))
(".config/waybar/style.css"
,(local-file "../examples/waybar/style.css"))
(".config/xfce4/helpers.rc"
,(plain-file "helpers.rc" "TerminalEmulator=rofi-sensible-terminal\n"))
;; Selected from the default skeletons.
(".config/gdb/gdbinit" ,%default-gdbinit)
(".config/nano/nanorc" ,%default-nanorc)
(".guile" ,%default-dotguile)))
;;; ;;;
;;; Service presets. ;;; Service presets.
@ -601,6 +535,8 @@ gtk-key-theme-name = ~a~%"
(bluetooth-configuration (bluetooth-configuration
(auto-enable? #t))) (auto-enable? #t)))
(service gvfs-service-type)
;; Screen lockers for Wayland environment. No dependencies are pulled ;; Screen lockers for Wayland environment. No dependencies are pulled
;; in since we're using empty files. ;; in since we're using empty files.
(service screen-locker-service-type (service screen-locker-service-type
@ -633,21 +569,13 @@ gtk-key-theme-name = ~a~%"
(identifier-syntax (rosenthal-desktop-services-for-system))) (identifier-syntax (rosenthal-desktop-services-for-system)))
(define %rosenthal-desktop-home-services (define %rosenthal-desktop-home-services
(cons* (service home-files-service-type (cons* (service home-shepherd-service-type
`((".guile" ,%default-dotguile)))
(service home-xdg-configuration-files-service-type
`(("gdb/gdbinit" ,%default-gdbinit)
("nano/nanorc" ,%default-nanorc)))
(service home-shepherd-service-type
(home-shepherd-configuration (home-shepherd-configuration
;; Start by WM to inherit environment variables for graphical session. ;; Start by WM to inherit environment variables for graphical session.
(auto-start? #f) (auto-start? #f)
(daemonize? #f))) (daemonize? #f)))
(service home-dbus-service-type) (service home-dbus-service-type)
(service home-pipewire-service-type) (service home-pipewire-service-type)
(service home-blueman-applet-service-type) (service home-blueman-applet-service-type)

View File

@ -8,6 +8,7 @@
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix records) #:use-module (guix records)
#:use-module (rosenthal utils packages)
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services configuration) #:use-module (gnu services configuration)