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

View File

@ -338,8 +338,8 @@ binds {
Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T { spawn "$$bin/alacritty$$"; }
Mod+D { spawn "$$bin/rofi$$" "-show" "drun"; }
Mod+T { spawn "foot"; }
Mod+D { spawn "rofi" "-show" "drun"; }
// Super+Alt+L { spawn "swaylock"; }
// 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.
// 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+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "$$bin/wpctl$$" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
XF86AudioMute allow-when-locked=true { spawn "$$bin/wpctl$$" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "$$bin/wpctl$$" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "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 "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
// Example brightness key mappings for light.
XF86MonBrightnessUp allow-when-locked=true { spawn "$$bin/light$$" "-A" "10"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "$$bin/light$$" "-U" "10"; }
XF86MonBrightnessUp allow-when-locked=true { spawn "light" "-A" "10"; }
XF86MonBrightnessDown allow-when-locked=true { spawn "light" "-U" "10"; }
Mod+Q { close-window; }
@ -578,7 +578,7 @@ binds {
prefer-no-csd
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 {
DISPLAY ":233"
}

View File

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

View File

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

View File

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