summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2026-02-05 10:53:41 +0800
committerHilton Chain <hako@ultrarare.space>2026-02-05 11:48:05 +0800
commit6c0ea215e0bd089bf3b2097e5c59dd726fbbe304 (patch)
treea9fc2182955bd82b76784a91b8a3ef47bf255e21
parent4e97b393a43ba9d64ace37e467fdd625e536cb45 (diff)
transformations: nvidia: Support S0ix-based power management.
* nonguix/transformations.scm (nonguix-transformation-nvidia) [#:s0ix-power-management?]: New argument. * README.org (System setup): Update
-rw-r--r--README.org6
-rw-r--r--nonguix/transformations.scm12
2 files changed, 13 insertions, 5 deletions
diff --git a/README.org b/README.org
index 12cec7d..d005d79 100644
--- a/README.org
+++ b/README.org
@@ -234,6 +234,7 @@ Procedure =nonguix-transformation-nvidia= is defined in the
234#+begin_example 234#+begin_example
235 nonguix-transformation-nvidia [#:driver nvda] 235 nonguix-transformation-nvidia [#:driver nvda]
236 [#:open-source-kernel-module? #f] 236 [#:open-source-kernel-module? #f]
237 [#:s0ix-power-management? #f]
237 [#:kernel-mode-setting? #t] 238 [#:kernel-mode-setting? #t]
238 [#:configure-xorg? #f] 239 [#:configure-xorg? #f]
239 240
@@ -243,6 +244,9 @@ Procedure =nonguix-transformation-nvidia= is defined in the
243 OPEN-SOURCE-KERNEL-MODULE? (default: #f) only supports Turing and later 244 OPEN-SOURCE-KERNEL-MODULE? (default: #f) only supports Turing and later
244 architectures and is expected to work with 'linux-lts'. 245 architectures and is expected to work with 'linux-lts'.
245 246
247 S0IX-POWER-MANAGEMENT? (default: #f) improves suspend and hibernate on systems
248 with supported graphics cards.
249
246 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
247 support. 251 support.
248 252
@@ -251,8 +255,6 @@ Procedure =nonguix-transformation-nvidia= is defined in the
251 255
252 Use 'replace-mesa', for application setup out of the operating system 256 Use 'replace-mesa', for application setup out of the operating system
253 declaration. 257 declaration.
254
255 TODO: Power management.
256#+end_example 258#+end_example
257 259
258For example, assuming the follow operating system declaration, defined as 260For example, assuming the follow operating system declaration, defined as
diff --git a/nonguix/transformations.scm b/nonguix/transformations.scm
index bb5b72a..e4a5c22 100644
--- a/nonguix/transformations.scm
+++ b/nonguix/transformations.scm
@@ -101,6 +101,7 @@ and INITRD (default: microcode-initrd)."
101 101
102(define* (nonguix-transformation-nvidia #:key (driver nvda) 102(define* (nonguix-transformation-nvidia #:key (driver nvda)
103 (open-source-kernel-module? #f) 103 (open-source-kernel-module? #f)
104 (s0ix-power-management? #f)
104 (kernel-mode-setting? #t) 105 (kernel-mode-setting? #t)
105 (configure-xorg? #f)) 106 (configure-xorg? #f))
106 "Return a procedure that transforms an operating system, setting up 107 "Return a procedure that transforms an operating system, setting up
@@ -109,6 +110,9 @@ DRIVER (default: nvda) for NVIDIA graphics card.
109OPEN-SOURCE-KERNEL-MODULE? (default: #f) only supports Turing and later 110OPEN-SOURCE-KERNEL-MODULE? (default: #f) only supports Turing and later
110architectures and is expected to work with 'linux-lts'. 111architectures and is expected to work with 'linux-lts'.
111 112
113S0IX-POWER-MANAGEMENT? (default: #f) improves suspend and hibernate on systems
114with supported graphics cards.
115
112KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg 116KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg
113support. 117support.
114 118
@@ -116,9 +120,7 @@ CONFIGURE-XORG? (default: #f) is required for Xorg display managers. Currently
116this argument configures the one used by '%desktop-services', GDM or SDDM. 120this argument configures the one used by '%desktop-services', GDM or SDDM.
117 121
118Use 'replace-mesa', for application setup out of the operating system 122Use 'replace-mesa', for application setup out of the operating system
119declaration. 123declaration."
120
121TODO: Power management."
122 (define %presets 124 (define %presets
123 `((,nvda . ,(service nvidia-service-type 125 `((,nvda . ,(service nvidia-service-type
124 (nvidia-configuration 126 (nvidia-configuration
@@ -142,6 +144,10 @@ TODO: Power management."
142 (kernel-arguments 144 (kernel-arguments
143 (delete-duplicates 145 (delete-duplicates
144 `("modprobe.blacklist=nouveau" 146 `("modprobe.blacklist=nouveau"
147 ,@(if s0ix-power-management?
148 '("mem_sleep_default=s2idle"
149 "nvidia.NVreg_EnableS0ixPowerManagement=1")
150 '())
145 ,(if kernel-mode-setting? 151 ,(if kernel-mode-setting?
146 "nvidia_drm.modeset=1" 152 "nvidia_drm.modeset=1"
147 "nvidia_drm.modeset=0") 153 "nvidia_drm.modeset=0")