diff options
| author | Hilton Chain <hako@ultrarare.space> | 2026-03-19 23:52:58 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2026-03-22 22:32:52 +0800 |
| commit | 7b33ad4f6854277480816dbf0f0734b74c83a127 (patch) | |
| tree | 9fe8e60cdd69599ace43764338e032f5f478f3ff | |
| parent | a571e99e9447f0544b15446c913ca127259dfbf5 (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.org | 15 | ||||
| -rw-r--r-- | nonguix/transformations.scm | 24 |
2 files changed, 32 insertions, 7 deletions
| @@ -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 | |||
| 291 | Full example below, using =compose= so that other system transformations can be | 302 | Full example below, using =compose= so that other system transformations can be |
| 292 | mixed in: | 303 | mixed 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. | |||
| 116 | KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg | 117 | KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg |
| 117 | support. | 118 | support. |
| 118 | 119 | ||
| 119 | CONFIGURE-XORG? (default: #f) is required for Xorg display managers. Currently | 120 | CONFIGURE-XORG? (default: #f) is required for Xorg display managers. When |
| 120 | this argument configures the one used by '%desktop-services', GDM or SDDM. | 121 | setting to #t, it configures the one specified by '%desktop-services'. If you |
| 122 | set up the display manager on your own, use its service type instead, | ||
| 123 | 'sddm-service-type', for example. | ||
| 121 | 124 | ||
| 122 | Use 'replace-mesa', for application setup out of the operating system | 125 | Use 'replace-mesa', for application setup out of the operating system |
| 123 | declaration." | 126 | declaration." |
| @@ -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))))) |
