diff options
| author | Giacomo Leidi <therewasa@fishinthecalculator.me> | 2026-01-04 23:58:56 +0100 |
|---|---|---|
| committer | Giacomo Leidi <therewasa@fishinthecalculator.me> | 2026-03-07 22:28:01 +0100 |
| commit | fd6b17bf20dc0cec2b4edff2928f899ebd2741cc (patch) | |
| tree | cc0ffd987b0f6e2766567ff0b83d7cc4a11652c9 /doc | |
| parent | 8ecab809db0584eb27fcde7c66bea5e8beb9fbc3 (diff) | |
gnu: Add tuned-service-type.
* gnu/services/linux.scm
(tuned-configuration,tuned-settings,tuned-ppd-settings): New
configuration records.
(tuned-file-systems,tuned-activation,tuned-shepherd-services,
tuned-kernel-modules): New procedures.
(tuned-service-type): New service type.
* doc/guix.texi: Add service documentation.
Change-Id: I6c8d54c23175c2ea133d99965641c548fb1d6452
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 198 |
1 files changed, 197 insertions, 1 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 15ed74ed0c1..d7f4c41d57f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -111,7 +111,7 @@ Copyright @copyright{} 2022 (@* | |||
| 111 | Copyright @copyright{} 2022 John Kehayias@* | 111 | Copyright @copyright{} 2022 John Kehayias@* |
| 112 | Copyright @copyright{} 2022–2023 Bruno Victal@* | 112 | Copyright @copyright{} 2022–2023 Bruno Victal@* |
| 113 | Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* | 113 | Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* |
| 114 | Copyright @copyright{} 2023-2025 Giacomo Leidi@* | 114 | Copyright @copyright{} 2023-2026 Giacomo Leidi@* |
| 115 | Copyright @copyright{} 2022 Antero Mejr@* | 115 | Copyright @copyright{} 2022 Antero Mejr@* |
| 116 | Copyright @copyright{} 2023 Karl Hallsby@* | 116 | Copyright @copyright{} 2023 Karl Hallsby@* |
| 117 | Copyright @copyright{} 2023 Nathaniel Nicandro@* | 117 | Copyright @copyright{} 2023 Nathaniel Nicandro@* |
| @@ -44972,6 +44972,202 @@ The database location is hard-coded to @file{/var/lib/rasdaemon/ras-mc_event.db} | |||
| 44972 | @end table | 44972 | @end table |
| 44973 | @end deftp | 44973 | @end deftp |
| 44974 | 44974 | ||
| 44975 | @cindex tuned | ||
| 44976 | @cindex system tuning | ||
| 44977 | @cindex System tuning service for Linux | ||
| 44978 | @subsubheading TuneD Service | ||
| 44979 | |||
| 44980 | @url{https://tuned-project.org,TuneD} is a system tuning service for Linux. It | ||
| 44981 | monitors connected devices using the udev device manager and tunes system | ||
| 44982 | settings according to a selected profile. | ||
| 44983 | |||
| 44984 | It can be integrated with desktop environments like GNOME and KDE: it replaces | ||
| 44985 | @code{power-profiles-daemon} by implementing the same D-Bus API that they | ||
| 44986 | already use. | ||
| 44987 | |||
| 44988 | The following is an example configuration that could be suitable for a laptop: | ||
| 44989 | |||
| 44990 | @lisp | ||
| 44991 | (service tuned-service-type | ||
| 44992 | (tuned-configuration | ||
| 44993 | (power-profiles-daemon-support? #t) | ||
| 44994 | (ppd-settings | ||
| 44995 | (tuned-ppd-settings | ||
| 44996 | ;; Customize default profiles to use laptop specific ones. | ||
| 44997 | (profiles | ||
| 44998 | '(("power-saver" . "laptop-ac-powersave") | ||
| 44999 | ("balanced" . "balanced") | ||
| 45000 | ("performance" . "throughput-performance"))) | ||
| 45001 | (battery | ||
| 45002 | ;; Customize battery profiles to use laptop specific ones. | ||
| 45003 | '(("power-saver" . "laptop-battery-powersave") | ||
| 45004 | ("balanced" . "balanced-battery"))))))) | ||
| 45005 | @end lisp | ||
| 45006 | |||
| 45007 | For more information, refer to @code{tuned-main.conf(5)}. | ||
| 45008 | |||
| 45009 | @defvar tuned-service-type | ||
| 45010 | This service spawns and configure the TuneD daemon. The service's value is a | ||
| 45011 | @code{tuned-configuration} record. | ||
| 45012 | |||
| 45013 | @c %start of fragment | ||
| 45014 | |||
| 45015 | @deftp {Data Type} tuned-configuration | ||
| 45016 | Available @code{tuned-configuration} fields are: | ||
| 45017 | |||
| 45018 | @table @asis | ||
| 45019 | @item @code{tuned} (default: @code{tuned}) (type: package) | ||
| 45020 | The TuneD package. | ||
| 45021 | |||
| 45022 | @item @code{auto-start?} (default: @code{#t}) (type: boolean) | ||
| 45023 | Whether this service should be started automatically by the Shepherd. If | ||
| 45024 | it is @code{#f} the service has to be started manually with | ||
| 45025 | @command{herd start}. | ||
| 45026 | |||
| 45027 | @item @code{power-profiles-daemon-support?} (default: @code{#f}) (type: boolean) | ||
| 45028 | Whether the power-profiles-daemon emulation layer should be | ||
| 45029 | enabled. | ||
| 45030 | |||
| 45031 | @item @code{profiles} (default: @code{'()}) (type: list-of-tuned-plugins) | ||
| 45032 | User provided profiles for TuneD. Each element of the list is supposed | ||
| 45033 | to be a list where the first element is the name of the directory where | ||
| 45034 | plugin files will be placed under @file{/etc/tuned/profiles} and the | ||
| 45035 | second a file like object containing the plugin files: | ||
| 45036 | |||
| 45037 | @lisp | ||
| 45038 | (list (list "plugin-name" (plain-file "plugin.conf" "content")) | ||
| 45039 | (list "other-plugin" | ||
| 45040 | (file-union "plugin-data" | ||
| 45041 | (list | ||
| 45042 | (list "other-plugin.conf" | ||
| 45043 | (plain-file "other-plugin.conf" "content")) | ||
| 45044 | (list "other-plugin.scm" | ||
| 45045 | (program-file "other-plugin.scm" | ||
| 45046 | #~(display "content"))))))) | ||
| 45047 | @end lisp | ||
| 45048 | |||
| 45049 | @item @code{settings} (type: tuned-settings) | ||
| 45050 | Configuration for TuneD. | ||
| 45051 | |||
| 45052 | @item @code{ppd-settings} (type: tuned-ppd-settings) | ||
| 45053 | Configuration for the @code{power-profiles-daemon} compatibility layer | ||
| 45054 | of TuneD. | ||
| 45055 | |||
| 45056 | @item @code{recommend.conf} (type: file-like) | ||
| 45057 | File like object containing the recommended profile configuration. | ||
| 45058 | Defaults to @code{%default-tuned-configuration-recommend.conf}. | ||
| 45059 | |||
| 45060 | @end table | ||
| 45061 | |||
| 45062 | @end deftp | ||
| 45063 | |||
| 45064 | |||
| 45065 | @c %end of fragment | ||
| 45066 | |||
| 45067 | |||
| 45068 | @c %start of fragment | ||
| 45069 | |||
| 45070 | @deftp {Data Type} tuned-settings | ||
| 45071 | Available @code{tuned-settings} fields are: | ||
| 45072 | |||
| 45073 | @table @asis | ||
| 45074 | @item @code{daemon?} (default: @code{#t}) (type: boolean) | ||
| 45075 | Whether to use daemon. Without daemon TuneD just applies tuning. | ||
| 45076 | |||
| 45077 | @item @code{dynamic-tuning?} (default: @code{#f}) (type: boolean) | ||
| 45078 | Dynamically tune devices, if disabled only static tuning will be used. | ||
| 45079 | |||
| 45080 | @item @code{default-instance-priority} (default: @code{0}) (type: integer) | ||
| 45081 | Default priority assigned to instances. | ||
| 45082 | |||
| 45083 | @item @code{recommend-command?} (default: @code{#t}) (type: boolean) | ||
| 45084 | Recommend functionality, if disabled @code{recommend} command will be | ||
| 45085 | not available in CLI, daemon will not parse @file{recommend.conf} but | ||
| 45086 | will return one hardcoded profile (by default @code{balanced}). | ||
| 45087 | |||
| 45088 | @item @code{sleep-interval} (default: @code{1}) (type: integer) | ||
| 45089 | How long to sleep before checking for events (in seconds), higher number | ||
| 45090 | means lower overhead but longer response time. | ||
| 45091 | |||
| 45092 | @item @code{update-interval} (default: @code{10}) (type: integer) | ||
| 45093 | Update interval for dynamic tunings (in seconds). It must be a multiple | ||
| 45094 | of the @code{sleep-interval}. | ||
| 45095 | |||
| 45096 | @item @code{profile-dirs} (type: list-of-profile-dirs) | ||
| 45097 | List of strings or gexps representing directories to search for | ||
| 45098 | profiles. In case of collisions in profile names, the latter directory | ||
| 45099 | takes precedence. | ||
| 45100 | |||
| 45101 | @item @code{extra-content} (type: text-config) | ||
| 45102 | A list of file-like objects that are appended to the configuration file. | ||
| 45103 | |||
| 45104 | @end table | ||
| 45105 | |||
| 45106 | @end deftp | ||
| 45107 | |||
| 45108 | |||
| 45109 | @c %end of fragment | ||
| 45110 | |||
| 45111 | |||
| 45112 | @c %start of fragment | ||
| 45113 | |||
| 45114 | @deftp {Data Type} tuned-ppd-settings | ||
| 45115 | Available @code{tuned-ppd-settings} fields are: | ||
| 45116 | |||
| 45117 | @table @asis | ||
| 45118 | @item @code{default} (default: @code{"balanced"}) (type: string) | ||
| 45119 | Default PPD profile. | ||
| 45120 | |||
| 45121 | @item @code{battery-detection?} (default: @code{#t}) (type: boolean) | ||
| 45122 | Whether to enable battery detection. | ||
| 45123 | |||
| 45124 | @item @code{sysfs-acpi-monitor?} (default: @code{#t}) (type: boolean) | ||
| 45125 | Whether to react to changes of ACPI platform profile done via function | ||
| 45126 | keys (e.g., Fn-L). This is marked upstream as an experimental feature. | ||
| 45127 | |||
| 45128 | @item @code{profiles} (type: mixed-list) | ||
| 45129 | Map of PPD profiles states to TuneD profiles. It's supposed to be a | ||
| 45130 | list of pairs, pair members are supposed to be string. It defaults to | ||
| 45131 | @code{%default-tuned-ppd-settings-profiles}: | ||
| 45132 | |||
| 45133 | @lisp | ||
| 45134 | '(("power-saver" . "powersave") | ||
| 45135 | ("balanced" . "balanced") | ||
| 45136 | ("performance" . "throughput-performance")) | ||
| 45137 | @end lisp | ||
| 45138 | |||
| 45139 | Elements can be pairs or strings. Pair members can be either strings, gexps or | ||
| 45140 | file like objects. Strings are directly passed to the serializer. This can be | ||
| 45141 | an escape hatch in case the underlying syntax of the output file changes | ||
| 45142 | slightly and the Scheme API is not adequated in time. This way there is always | ||
| 45143 | a way to work around Scheme records. | ||
| 45144 | |||
| 45145 | @item @code{battery} (type: mixed-list) | ||
| 45146 | Map of PPD battery states to TuneD profiles. It's supposed to be a list | ||
| 45147 | of pairs, pair members are supposed to be string. It defaults to | ||
| 45148 | @code{%default-tuned-ppd-settings-battery}: | ||
| 45149 | |||
| 45150 | @lisp | ||
| 45151 | '(("balanced" . "balanced-battery")) | ||
| 45152 | @end lisp | ||
| 45153 | |||
| 45154 | Elements can be pairs or strings. Pair members can be either strings, gexps or | ||
| 45155 | file like objects. Strings are directly passed to the serializer. This can be | ||
| 45156 | an escape hatch in case the underlying syntax of the output file changes | ||
| 45157 | slightly and the Scheme API is not adequated in time. This way there is always | ||
| 45158 | a way to work around Scheme records. | ||
| 45159 | |||
| 45160 | @item @code{extra-content} (type: text-config) | ||
| 45161 | A list of file-like objects that are appended to the configuration file. | ||
| 45162 | |||
| 45163 | @end table | ||
| 45164 | |||
| 45165 | @end deftp | ||
| 45166 | |||
| 45167 | |||
| 45168 | @c %end of fragment | ||
| 45169 | @end defvar | ||
| 45170 | |||
| 44975 | @cindex zram | 45171 | @cindex zram |
| 44976 | @cindex compressed swap | 45172 | @cindex compressed swap |
| 44977 | @cindex Compressed RAM-based block devices | 45173 | @cindex Compressed RAM-based block devices |
