summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2026-03-19 23:52:58 +0800
committerHilton Chain <hako@ultrarare.space>2026-03-22 22:32:52 +0800
commit7b33ad4f6854277480816dbf0f0734b74c83a127 (patch)
tree9fe8e60cdd69599ace43764338e032f5f478f3ff
parenta571e99e9447f0544b15446c913ca127259dfbf5 (diff)
transformations: nvidia: Allow specifying display manager in ‘#:configure-xorg?’.
* nonguix/transformations.scm (nonguix-transformation-nvidia): Allow passing display manager service type to ‘#:configure-xorg?’. * README.org (System setup): Update docstring.
-rw-r--r--README.org15
-rw-r--r--nonguix/transformations.scm24
2 files changed, 32 insertions, 7 deletions
diff --git a/README.org b/README.org
index d005d79..576b535 100644
--- a/README.org
+++ b/README.org
@@ -250,8 +250,10 @@ Procedure =nonguix-transformation-nvidia= is defined in the
250 KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg 250 KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg
251 support. 251 support.
252 252
253 CONFIGURE-XORG? (default: #f) is required for Xorg display managers. Currently 253 CONFIGURE-XORG? (default: #f) is required for Xorg display managers. When
254 this argument configures the one used by '%desktop-services', GDM or SDDM. 254 setting to #t, it configures the one specified by '%desktop-services'. If you
255 set up the display manager on your own, use its service type instead,
256 'sddm-service-type', for example.
255 257
256 Use 'replace-mesa', for application setup out of the operating system 258 Use 'replace-mesa', for application setup out of the operating system
257 declaration. 259 declaration.
@@ -283,11 +285,20 @@ variable =%my-os=:
283 285
284- Xorg environmnet: =#:configure-xorg?=: 286- Xorg environmnet: =#:configure-xorg?=:
285 287
288 Set to =#t= when you're using =%desktop-services=.
289
286 #+begin_src scheme 290 #+begin_src scheme
287 ((nonguix-transformation-nvidia #:configure-xorg? #t) 291 ((nonguix-transformation-nvidia #:configure-xorg? #t)
288 %my-os) 292 %my-os)
289 #+end_src 293 #+end_src
290 294
295 Specify service type of your display manager otherwine.
296
297 #+begin_src scheme
298 ((nonguix-transformation-nvidia #:configure-xorg? sddm-service-type)
299 %my-os)
300 #+end_src
301
291Full example below, using =compose= so that other system transformations can be 302Full example below, using =compose= so that other system transformations can be
292mixed in: 303mixed in:
293 304
diff --git a/nonguix/transformations.scm b/nonguix/transformations.scm
index 043b6d7..e31bbce 100644
--- a/nonguix/transformations.scm
+++ b/nonguix/transformations.scm
@@ -2,6 +2,7 @@
2;;; Copyright © 2025 Hilton Chain <hako@ultrarare.space> 2;;; Copyright © 2025 Hilton Chain <hako@ultrarare.space>
3 3
4(define-module (nonguix transformations) 4(define-module (nonguix transformations)
5 #:use-module (ice-9 match)
5 #:use-module (srfi srfi-1) 6 #:use-module (srfi srfi-1)
6 #:use-module (srfi srfi-26) 7 #:use-module (srfi srfi-26)
7 #:use-module (guix channels) 8 #:use-module (guix channels)
@@ -116,8 +117,10 @@ with supported graphics cards.
116KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg 117KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg
117support. 118support.
118 119
119CONFIGURE-XORG? (default: #f) is required for Xorg display managers. Currently 120CONFIGURE-XORG? (default: #f) is required for Xorg display managers. When
120this argument configures the one used by '%desktop-services', GDM or SDDM. 121setting to #t, it configures the one specified by '%desktop-services'. If you
122set up the display manager on your own, use its service type instead,
123'sddm-service-type', for example.
121 124
122Use 'replace-mesa', for application setup out of the operating system 125Use 'replace-mesa', for application setup out of the operating system
123declaration." 126declaration."
@@ -150,6 +153,19 @@ declaration."
150 nvidia-module-590)) 153 nvidia-module-590))
151 (modprobe nvidia-modprobe-590)))))) 154 (modprobe nvidia-modprobe-590))))))
152 155
156 (define %xorg-extension
157 (and=> configure-xorg?
158 (match-lambda
159 (#t
160 (set-xorg-configuration
161 (xorg-configuration
162 (modules (list driver)))))
163 (display-manager
164 (set-xorg-configuration
165 (xorg-configuration
166 (modules (list driver)))
167 display-manager)))))
168
153 (lambda (os) 169 (lambda (os)
154 (operating-system 170 (operating-system
155 (inherit os) 171 (inherit os)
@@ -176,9 +192,7 @@ declaration."
176 (G_ "no NVIDIA service configuration available for '~a'~%") 192 (G_ "no NVIDIA service configuration available for '~a'~%")
177 (package-name driver))) 193 (package-name driver)))
178 ,@(if configure-xorg? 194 ,@(if configure-xorg?
179 (list (set-xorg-configuration 195 (list %xorg-extension)
180 (xorg-configuration
181 (modules (list driver)))))
182 '()) 196 '())
183 ,@(operating-system-user-services os)) 197 ,@(operating-system-user-services os))
184 #:driver driver))))) 198 #:driver driver)))))