diff options
| author | Hilton Chain <hako@ultrarare.space> | 2026-02-05 10:53:41 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2026-02-05 11:48:05 +0800 |
| commit | 6c0ea215e0bd089bf3b2097e5c59dd726fbbe304 (patch) | |
| tree | a9fc2182955bd82b76784a91b8a3ef47bf255e21 | |
| parent | 4e97b393a43ba9d64ace37e467fdd625e536cb45 (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.org | 6 | ||||
| -rw-r--r-- | nonguix/transformations.scm | 12 |
2 files changed, 13 insertions, 5 deletions
| @@ -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 | ||
| 258 | For example, assuming the follow operating system declaration, defined as | 260 | For 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. | |||
| 109 | OPEN-SOURCE-KERNEL-MODULE? (default: #f) only supports Turing and later | 110 | OPEN-SOURCE-KERNEL-MODULE? (default: #f) only supports Turing and later |
| 110 | architectures and is expected to work with 'linux-lts'. | 111 | architectures and is expected to work with 'linux-lts'. |
| 111 | 112 | ||
| 113 | S0IX-POWER-MANAGEMENT? (default: #f) improves suspend and hibernate on systems | ||
| 114 | with supported graphics cards. | ||
| 115 | |||
| 112 | KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg | 116 | KERNEL-MODE-SETTING? (default: #t) is required for Wayland and rootless Xorg |
| 113 | support. | 117 | support. |
| 114 | 118 | ||
| @@ -116,9 +120,7 @@ CONFIGURE-XORG? (default: #f) is required for Xorg display managers. Currently | |||
| 116 | this argument configures the one used by '%desktop-services', GDM or SDDM. | 120 | this argument configures the one used by '%desktop-services', GDM or SDDM. |
| 117 | 121 | ||
| 118 | Use 'replace-mesa', for application setup out of the operating system | 122 | Use 'replace-mesa', for application setup out of the operating system |
| 119 | declaration. | 123 | declaration." |
| 120 | |||
| 121 | TODO: 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") |
