unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#70460] [PATCH 0/4] Update power-profiles-daemon and add a service-type for it.
@ 2024-04-18 18:31 Dariqq
  2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
  0 siblings, 1 reply; 9+ messages in thread
From: Dariqq @ 2024-04-18 18:31 UTC (permalink / raw)
  To: 70460; +Cc: Dariqq

Hi Guix,

Here are a couple of patches that update the power-profiles-daemon to the latest release and add a corresponding service for it which will make changing power-profiles available in DEs like GNOME or via the cli tool.

I am not sure if some of the python dependencies should be normal inputs rather than native inputs.

The package will now also build the shell completions, manpage, docs and skip installing the systemd unit.
Also I was not sure if the gtk-docs should go to a seperate doc output but this corresponds to ~0.2 MB so I didn't bother.

The daemon is supposed to be a systemd unit started via dbus but just autostarting a similiar shepherd service seems fine as well and is what other distros without systemd do (i.e gentoo or void linux).

I've also tried to patch the dbus service definiton to run the daemon directly and it seems to work as well which would make the shepherd service obsolete. I am not sure what the better solution is.

The systemd unit specifies a 'conflict' with other power-management services like tlp but I don't think something similiar can be done for the shepherd right now.

The service-type is a rather simple and has the following extensions:
shepherd: Run the daemon.
dbus: Make the name of the service available.
polkit: Allow normal users to change power profile.
profile: Make the cli tool available.
activation: Create a directory.

As this is my first time writing a service-type any feedback would be greatly appreciated.

This would fix #69061.

Dariqq (4):
  gnu: power-profiles-daemon: Update to 0.21.
  gnu: power-profiles-daemon: Build gtk-docs.
  gnu: power-profiles-daemon: Remove some (native) inputs.
  gnu: services: Add power-profiles-daemon-service-type.

 gnu/packages/freedesktop.scm | 45 ++++++++++++++++-------------
 gnu/services/pm.scm          | 56 +++++++++++++++++++++++++++++++++++-
 2 files changed, 80 insertions(+), 21 deletions(-)


base-commit: 65e8472a4b6fc6f66871ba0dad518b7d4c63595e
-- 
2.41.0





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 0/3] Update power-profiles-daemon and add a service-type for it.
  2024-04-18 18:31 [bug#70460] [PATCH 0/4] Update power-profiles-daemon and add a service-type for it Dariqq
@ 2024-05-02 15:37 ` Dariqq
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 1/3] gnu: power-profiles-daemon: Update to 0.21 Dariqq
                     ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Dariqq @ 2024-05-02 15:37 UTC (permalink / raw)
  To: 70460; +Cc: Dariqq, felix, Florian Pelz, Ludovic Courtès

Hi all,

Here is v2 of the patches.

I hope the added manual entry is ok as I don't have prior experience writing texinfo. I've added the note not to use tlp and p-p-d together there too.

Also is there a better way to set the pythonpath to not include the packages in native-inputs? This decreases guix size of the package by 100 MB.

Changes compared to v1:

* Added the commit removing inputs to the first commit.
* Added back python and python-pygobject as inputs (previously propagated from python-dbusmock in native-inputs).
* Set GUIX_PYTHONPATH to only refer to nonnative python inputs rather than all.
* Moved gtk-docs to a seperate doc output.
* Added a short entry in the manual for the service-type.
* Added my copyright line in all files.

Things that could still be improved:
* The generated manpage looks horrible because python-argparse-manpage is outdated. I've tried updating it but ran into test errors.
* Test timeout issues on qa? I am not sure what to do here as it is kind of hard for me to guess what an appropriate timeout window would be that would work.


Dariqq (3):
  gnu: power-profiles-daemon: Update to 0.21.
  gnu: power-profiles-daemon: Build gtk-docs.
  gnu: services: Add power-profiles-daemon-service-type.

 doc/guix.texi                | 40 +++++++++++++++++++++++++
 gnu/packages/freedesktop.scm | 56 +++++++++++++++++++++++------------
 gnu/services/pm.scm          | 57 +++++++++++++++++++++++++++++++++++-
 3 files changed, 134 insertions(+), 19 deletions(-)


base-commit: 5010a51fc91aeac5a3b87a3eea04f18f3fe8a3a3
-- 
2.41.0





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 1/3] gnu: power-profiles-daemon: Update to 0.21.
  2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
@ 2024-05-02 15:37   ` Dariqq
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 2/3] gnu: power-profiles-daemon: Build gtk-docs Dariqq
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Dariqq @ 2024-05-02 15:37 UTC (permalink / raw)
  To: 70460; +Cc: Dariqq, felix

* gnu/packages/freedesktop (power-profiles-daemon): Update to 0.21.
[origin]<url>: Update repository url.
[homepage]: Update homepage.
[#:configure-flags]: Enable zsh completions, disable systemd-unit and
pylint.
[#:glib-or-gtk?]: Set to default value of #f.
[#:phases]<'fake-pkexec>: Remove phase, seems no longer necessary.
<'correct-polkit-dir>: Change to setting envvar instead.
<'wrap-program>: Remove GI_TYPELIB_PATH from wrapper. Remove native python
inputs from PYTHONPATH.
[native-inputs]: Add python-argparse-manpage, python-dbusmock, python-shtab,
umockdev. Remove gobject-introspection, vala.
[inputs]: Add bash-completion. Remove dbus, dbus-glib.

Change-Id: I71220957ef6f4d224cc4c528562fe0565505aae1
---
 gnu/packages/freedesktop.scm | 46 ++++++++++++++++++++++--------------
 1 file changed, 28 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 081269ebaf..53cae544aa 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -37,6 +37,7 @@
 ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2022 Samuel Culpepper <sculpepper@newstore.com>
 ;;; Copyright © 2024 aurtzy <aurtzy@gmail.com>
+;;; Copyright © 2024 Dariqq <dariqq@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1156,48 +1157,57 @@ (define-public packagekit
 (define-public power-profiles-daemon
   (package
     (name "power-profiles-daemon")
-    (version "0.12")
+    (version "0.21")
     (source
      (origin
        (method git-fetch)
        (uri (git-reference
-             (url "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+             (url "https://gitlab.freedesktop.org/upower/power-profiles-daemon")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1wqcajbj358zpyj6y4h1v34y2yncq76wqxd0jm431habcly0bqyr"))))
+         "0dn3ygv49q7mzs52ch3yphxf4hbry698r1ajj52f6jgw7mpwr5p4"))))
     (build-system meson-build-system)
     (arguments
-     (list #:configure-flags #~(list "-Dsystemdsystemunitdir=false")
-           #:glib-or-gtk? #t
+     (list #:configure-flags #~(list "-Dsystemdsystemunitdir="
+                                     "-Dpylint=disabled"
+                                     (string-append "-Dzshcomp=" #$output
+                                                    "/share/zsh/site-functions/"))
            #:phases
            #~(modify-phases %standard-phases
-               (add-before 'install 'fake-pkexec
-                 (lambda _ (setenv "PKEXEC_UID" "-1")))
                (add-before 'configure 'correct-polkit-dir
                  (lambda _
-                   (substitute* "meson.build"
-                     (("polkit_gobject_dep\\..*")
-                      (string-append "'" #$output "/share/polkit-1/actions'")))))
+                   (setenv "PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR"
+                           (string-append #$output "/share/polkit-1/actions"))))
                (add-after 'install 'wrap-program
                  (lambda _
                    (wrap-program
                        (string-append #$output "/bin/powerprofilesctl")
-                     `("GUIX_PYTHONPATH" = (,(getenv "GUIX_PYTHONPATH")))
-                     `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))
+                     `("GUIX_PYTHONPATH" = (,(string-append
+                                              #$(this-package-input "python-pygobject")
+                                              "/lib/python"
+                                              #$(version-major+minor
+                                                 (package-version (this-package-input "python")))
+                                              "/site-packages")))))))))
     (native-inputs
-     (list `(,glib "bin") gobject-introspection pkg-config python vala))
+     (list `(,glib "bin")
+           pkg-config
+           python
+           python-argparse-manpage
+           python-dbusmock
+           python-shtab
+           umockdev))
     (inputs
-     (list bash-minimal                           ;for 'wrap-program'
-           dbus
-           dbus-glib
+     (list bash-minimal                 ;for 'wrap-program'
+           bash-completion
            libgudev
-           glib polkit
+           glib
+           polkit
            python
            python-pygobject
            upower))
-    (home-page "https://gitlab.freedesktop.org/hadess/power-profiles-daemon")
+    (home-page "https://gitlab.freedesktop.org/upower/power-profiles-daemon")
     (synopsis "Power profile handling over D-Bus")
     (description
      "power-profiles-daemon offers to modify system behaviour based upon
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 2/3] gnu: power-profiles-daemon: Build gtk-docs.
  2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 1/3] gnu: power-profiles-daemon: Update to 0.21 Dariqq
@ 2024-05-02 15:37   ` Dariqq
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type Dariqq
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Dariqq @ 2024-05-02 15:37 UTC (permalink / raw)
  To: 70460; +Cc: Dariqq, felix

* gnu/packages/freedesktop.scm (power-profiles-daemon):
[outputs]: Add docs output.
[#:configure-flags]: Enable building gtk-docs.
[#:phases]: Add a phase to move gtk-docs to docs output.
[inputs]: Add gtk-doc/stable, libxslt for docs.

Change-Id: I1bc6047858d2b5188e714f39da8b760bc6a71078
---
 gnu/packages/freedesktop.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/freedesktop.scm b/gnu/packages/freedesktop.scm
index 53cae544aa..a77dab5794 100644
--- a/gnu/packages/freedesktop.scm
+++ b/gnu/packages/freedesktop.scm
@@ -1169,9 +1169,11 @@ (define-public power-profiles-daemon
         (base32
          "0dn3ygv49q7mzs52ch3yphxf4hbry698r1ajj52f6jgw7mpwr5p4"))))
     (build-system meson-build-system)
+    (outputs '("out" "doc"))
     (arguments
      (list #:configure-flags #~(list "-Dsystemdsystemunitdir="
                                      "-Dpylint=disabled"
+                                     "-Dgtk_doc=true"
                                      (string-append "-Dzshcomp=" #$output
                                                     "/share/zsh/site-functions/"))
            #:phases
@@ -1189,9 +1191,17 @@ (define-public power-profiles-daemon
                                               "/lib/python"
                                               #$(version-major+minor
                                                  (package-version (this-package-input "python")))
-                                              "/site-packages")))))))))
+                                              "/site-packages"))))))
+               (add-after 'install 'move-docs
+                 (lambda _
+                   (mkdir-p (string-append #$output:doc "/share"))
+                   (rename-file
+                    (string-append #$output "/share/gtk-doc")
+                    (string-append #$output:doc "/share/gtk-doc")))))))
     (native-inputs
      (list `(,glib "bin")
+           gtk-doc/stable
+           libxslt
            pkg-config
            python
            python-argparse-manpage
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type.
  2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 1/3] gnu: power-profiles-daemon: Update to 0.21 Dariqq
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 2/3] gnu: power-profiles-daemon: Build gtk-docs Dariqq
@ 2024-05-02 15:37   ` Dariqq
  2024-05-25 13:29     ` Ludovic Courtès
  2024-05-09  8:00   ` [bug#70460] [PATCH v2 0/3] Update power-profiles-daemon and add a service-type for it Dariqq
  2024-05-16  6:55   ` bug#70460: " Christopher Baines
  4 siblings, 1 reply; 9+ messages in thread
From: Dariqq @ 2024-05-02 15:37 UTC (permalink / raw)
  To: 70460; +Cc: Dariqq, felix, Florian Pelz, Ludovic Courtès

* gnu/services/pm.scm
(power-profiles-configuration): New configuration.
(power-profiles-daemon-shepherd-service): New procedure.
(power-profiles-daemon-activation): New variable.
(power-profiles-daemon-service-type): New procedure.
* doc/guix.texi (Power Management Services): Document it.

Change-Id: Ib035d993ed82eec2a43f3ba2b4c92f77e08a0fd7
---
 doc/guix.texi       | 40 +++++++++++++++++++++++++++++++
 gnu/services/pm.scm | 57 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 96 insertions(+), 1 deletion(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 749d689ac1..533715fd91 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -127,6 +127,7 @@
 Copyright @copyright{} 2024 Herman Rimm@*
 Copyright @copyright{} 2024 Matthew Trzcinski@*
 Copyright @copyright{} 2024 Richard Sent@*
+Copyright @copyright{} 2024 Dariqq@*
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -34669,6 +34670,45 @@ Continuous Integration
 @node Power Management Services
 @subsection Power Management Services
 
+@cindex power-profiles-daemon
+@subsubheading Power Profiles Daemon
+
+The @code{(gnu services pm)} module provides a Guix service definition for
+the Linux Power Profiles Daemon, which makes power profiles handling
+available over D-Bus.
+
+The available profiles consist of the default @samp{balanced} mode, a @samp{power-saver} mode
+and on supported systems a @samp{performance} mode.
+
+@quotation Important
+The @code{power-profiles-daemon} conflicts with other power management tools
+like @code{tlp}. Using both together is not recommended.
+@end quotation
+
+@defvar power-profiles-daemon-service-type
+This is the service type for the
+@uref{https://gitlab.freedesktop.org/upower/power-profiles-daemon/, Power Profiles Daemon}.
+The value for this service is a @code{power-profiles-daemon-configuration}.
+
+To enable the Power Profiles Daemon with default configuration
+add this line to your services:
+
+@lisp
+(service power-profiles-daemon-service-type)
+@end lisp
+@end defvar
+
+@deftp {Data Type} power-profiles-daemon-configuration
+Data type representing the configuration of @code{power-profiles-daemon-service-type}.
+
+@table @asis
+@item @code{power-profiles-daemon} (default: @code{power-profiles-daemon}) (type: file-like)
+Package object of power-profiles-daemon.
+
+@end table
+@end deftp
+
+
 @cindex tlp
 @cindex power management with TLP
 @subsubheading TLP daemon
diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index 3daf484cc1..33d2c07367 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
+;;; Copyright © 2024 Dariqq <dariqq@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,18 +22,72 @@ (define-module (gnu services pm)
   #:use-module (guix packages)
   #:use-module (guix records)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages linux)
   #:use-module (gnu services)
   #:use-module (gnu services base)
   #:use-module (gnu services configuration)
+  #:use-module (gnu services dbus)
   #:use-module (gnu services shepherd)
   #:use-module (gnu system shadow)
-  #:export (tlp-service-type
+  #:export (power-profiles-daemon-service-type
+            power-profiles-daemon-configuration
+
+            tlp-service-type
             tlp-configuration
 
             thermald-configuration
             thermald-service-type))
 
+;;;
+;;; power-profiles-daemon
+;;;
+
+(define-configuration/no-serialization power-profiles-daemon-configuration
+  (power-profiles-daemon
+   (file-like power-profiles-daemon)
+   "The power-profiles-daemon package."))
+
+(define (power-profiles-daemon-shepherd-service config)
+  (match-record
+      config <power-profiles-daemon-configuration>
+      (power-profiles-daemon)
+    (list (shepherd-service (provision '(power-profiles-daemon))
+			    (requirement '(dbus-system))
+                            (documentation "Run the power-profiles-daemon.")
+			    (start #~(make-forkexec-constructor
+				      (list #$(file-append power-profiles-daemon
+                                                           "/libexec/power-profiles-daemon"))))
+			    (stop #~(make-kill-destructor))))))
+
+(define %power-profiles-daemon-activation
+  #~(begin
+      (use-modules (guix build utils))
+      (mkdir-p "/var/lib/power-profiles-daemon")))
+
+(define power-profiles-daemon-service-type
+  (let ((config->package
+         (compose list power-profiles-daemon-configuration-power-profiles-daemon)))
+    (service-type
+     (name 'power-profiles-daemon)
+     (extensions (list
+                  (service-extension shepherd-root-service-type
+                                     power-profiles-daemon-shepherd-service)
+                  (service-extension dbus-root-service-type
+                                     config->package)
+                  (service-extension polkit-service-type
+                                     config->package)
+                  (service-extension profile-service-type
+                                     config->package)
+                  (service-extension activation-service-type
+                                     (const %power-profiles-daemon-activation))))
+     (default-value (power-profiles-daemon-configuration))
+     (description "Run the power-profiles-daemon"))))
+
+;;;
+;;; tlp
+;;;
+
 (define (uglify-field-name field-name)
   (let ((str (symbol->string field-name)))
     (string-join (string-split
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 0/3] Update power-profiles-daemon and add a service-type for it.
  2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
                     ` (2 preceding siblings ...)
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type Dariqq
@ 2024-05-09  8:00   ` Dariqq
  2024-05-16  6:55   ` bug#70460: " Christopher Baines
  4 siblings, 0 replies; 9+ messages in thread
From: Dariqq @ 2024-05-09  8:00 UTC (permalink / raw)
  To: 70460; +Cc: felix



On 02.05.24 17:37, Dariqq wrote:
> Hi all,
> 
> Here is v2 of the patches.
> 
> I hope the added manual entry is ok as I don't have prior experience writing texinfo. I've added the note not to use tlp and p-p-d together there too.
> 
> Also is there a better way to set the pythonpath to not include the packages in native-inputs? This decreases guix size of the package by 100 MB.
> 
> Changes compared to v1:
> 
> * Added the commit removing inputs to the first commit.
> * Added back python and python-pygobject as inputs (previously propagated from python-dbusmock in native-inputs).
> * Set GUIX_PYTHONPATH to only refer to nonnative python inputs rather than all.
> * Moved gtk-docs to a seperate doc output.
> * Added a short entry in the manual for the service-type.
> * Added my copyright line in all files.
> 
> Things that could still be improved:
> * The generated manpage looks horrible because python-argparse-manpage is outdated. I've tried updating it but ran into test errors.

For the manpage I've updated python-argparse-manpage in #70834 which got 
pushed yesterday which fixes the manpage for me locally.


> * Test timeout issues on qa? I am not sure what to do here as it is kind of hard for me to guess what an appropriate timeout window would be that would work.
> 
> 

It seems to succeeding now. Maybe we just got lucky this time?

> Dariqq (3):
>    gnu: power-profiles-daemon: Update to 0.21.
>    gnu: power-profiles-daemon: Build gtk-docs.
>    gnu: services: Add power-profiles-daemon-service-type.
> 
>   doc/guix.texi                | 40 +++++++++++++++++++++++++
>   gnu/packages/freedesktop.scm | 56 +++++++++++++++++++++++------------
>   gnu/services/pm.scm          | 57 +++++++++++++++++++++++++++++++++++-
>   3 files changed, 134 insertions(+), 19 deletions(-)
> 
> 
> base-commit: 5010a51fc91aeac5a3b87a3eea04f18f3fe8a3a3




^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#70460: [PATCH v2 0/3] Update power-profiles-daemon and add a service-type for it.
  2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
                     ` (3 preceding siblings ...)
  2024-05-09  8:00   ` [bug#70460] [PATCH v2 0/3] Update power-profiles-daemon and add a service-type for it Dariqq
@ 2024-05-16  6:55   ` Christopher Baines
  4 siblings, 0 replies; 9+ messages in thread
From: Christopher Baines @ 2024-05-16  6:55 UTC (permalink / raw)
  To: Dariqq; +Cc: 70460-done, felix

[-- Attachment #1: Type: text/plain, Size: 1349 bytes --]

Dariqq <dariqq@posteo.net> writes:

> Hi all,
>
> Here is v2 of the patches.
>
> I hope the added manual entry is ok as I don't have prior experience
> writing texinfo. I've added the note not to use tlp and p-p-d together
> there too.
>
> Also is there a better way to set the pythonpath to not include the
> packages in native-inputs? This decreases guix size of the package by
> 100 MB.

...

> Things that could still be improved:
> * The generated manpage looks horrible because python-argparse-manpage
> is outdated. I've tried updating it but ran into test errors.
> * Test timeout issues on qa? I am not sure what to do here as it is
> kind of hard for me to guess what an appropriate timeout window would
> be that would work.
>
>
> Dariqq (3):
>   gnu: power-profiles-daemon: Update to 0.21.
>   gnu: power-profiles-daemon: Build gtk-docs.
>   gnu: services: Add power-profiles-daemon-service-type.
>
>  doc/guix.texi                | 40 +++++++++++++++++++++++++
>  gnu/packages/freedesktop.scm | 56 +++++++++++++++++++++++------------
>  gnu/services/pm.scm          | 57 +++++++++++++++++++++++++++++++++++-
>  3 files changed, 134 insertions(+), 19 deletions(-)

Thanks both, these patches look good to me. I removed some tabs and
tweaked some indentation and pushed these to master as
d0ad4f557fc8b9d105877f2ef4de0ce12c5c9566.

Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type.
  2024-05-02 15:37   ` [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type Dariqq
@ 2024-05-25 13:29     ` Ludovic Courtès
  2024-05-25 15:15       ` Dariqq
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2024-05-25 13:29 UTC (permalink / raw)
  To: Dariqq; +Cc: 70460, felix, Florian Pelz

Hi!

Dariqq <dariqq@posteo.net> skribis:

> * gnu/services/pm.scm
> (power-profiles-configuration): New configuration.
> (power-profiles-daemon-shepherd-service): New procedure.
> (power-profiles-daemon-activation): New variable.
> (power-profiles-daemon-service-type): New procedure.
> * doc/guix.texi (Power Management Services): Document it.
>
> Change-Id: Ib035d993ed82eec2a43f3ba2b4c92f77e08a0fd7

[…]

> +@quotation Important
> +The @code{power-profiles-daemon} conflicts with other power management tools
> +like @code{tlp}. Using both together is not recommended.

s/like/such as/
s/Using.*/Pick one or the other./

What about UPower?  Do I get it right that this actually builds upon
UPower?

Should it say a word about how it defers from TLP?

> +(define (power-profiles-daemon-shepherd-service config)
> +  (match-record
> +      config <power-profiles-daemon-configuration>
> +      (power-profiles-daemon)
> +    (list (shepherd-service (provision '(power-profiles-daemon))
> +			    (requirement '(dbus-system))

Rather: (requirement '(user-processes dbus-system)).

> +                            (documentation "Run the power-profiles-daemon.")

Nitpick: “Run the Power Profiles Daemon”.

Also please indent this procedure similar to how this is done elsewhere.

> +     (description "Run the power-profiles-daemon"))))

Same as above.  :-)

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type.
  2024-05-25 13:29     ` Ludovic Courtès
@ 2024-05-25 15:15       ` Dariqq
  0 siblings, 0 replies; 9+ messages in thread
From: Dariqq @ 2024-05-25 15:15 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 70460, felix, Florian Pelz

Hi Ludo,

Thanks for the feedback. As this was pushed to master last week i am 
unsure how to incorporate it.

On 25.05.24 15:29, Ludovic Courtès wrote:
> Hi!
> 
> Dariqq <dariqq@posteo.net> skribis:
> 
>> * gnu/services/pm.scm
>> (power-profiles-configuration): New configuration.
>> (power-profiles-daemon-shepherd-service): New procedure.
>> (power-profiles-daemon-activation): New variable.
>> (power-profiles-daemon-service-type): New procedure.
>> * doc/guix.texi (Power Management Services): Document it.
>>
>> Change-Id: Ib035d993ed82eec2a43f3ba2b4c92f77e08a0fd7
> 
> […]
> 
>> +@quotation Important
>> +The @code{power-profiles-daemon} conflicts with other power management tools
>> +like @code{tlp}. Using both together is not recommended.
> 
> s/like/such as/
> s/Using.*/Pick one or the other./
> 
> What about UPower?  Do I get it right that this actually builds upon
> UPower?
> 

This comment is based on the information from 
https://gitlab.freedesktop.org/upower/power-profiles-daemon#conflicts. 
The systemd unit file specifies a conflict with tuned.service, 
tlp.service, auto-cpufreq.service and system76-power.service and I was 
not sure how to communicate this other with a big warning in the 
documentation.

Another option I thought about since then was to make p-p-d and tlp 
also provide a generic power-management name (suggestions for a better 
name are welcome) similiar to what is done with login-mangers providing 
xorg-server such that shepherd will not allow both at the same time.


> Should it say a word about how it defers from TLP?

Skimming through the tlp documentation 
(https://linrunner.de/tlp/faq/ppd.html) and the p-p-d README 
(https://gitlab.freedesktop.org/upower/power-profiles-daemon#why-not) 
main points seem to be:

- tlp is more customizable offering more (potentially destructive) 
options and fine-grained control
- p-p-d is more generic and with the integrations in DEs like GNOME, 
KDE, etc easier to use for normal desktop users.
> 
>> +(define (power-profiles-daemon-shepherd-service config)
>> +  (match-record
>> +      config <power-profiles-daemon-configuration>
>> +      (power-profiles-daemon)
>> +    (list (shepherd-service (provision '(power-profiles-daemon))
>> +			    (requirement '(dbus-system))
> 
> Rather: (requirement '(user-processes dbus-system)).
> 
>> +                            (documentation "Run the power-profiles-daemon.")
> 
> Nitpick: “Run the Power Profiles Daemon”.
> 
> Also please indent this procedure similar to how this is done elsewhere.
> 
>> +     (description "Run the power-profiles-daemon"))))
> 
> Same as above.  :-)
> 
> Thanks!
> 
> Ludo’.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-05-25 15:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-18 18:31 [bug#70460] [PATCH 0/4] Update power-profiles-daemon and add a service-type for it Dariqq
2024-05-02 15:37 ` [bug#70460] [PATCH v2 0/3] " Dariqq
2024-05-02 15:37   ` [bug#70460] [PATCH v2 1/3] gnu: power-profiles-daemon: Update to 0.21 Dariqq
2024-05-02 15:37   ` [bug#70460] [PATCH v2 2/3] gnu: power-profiles-daemon: Build gtk-docs Dariqq
2024-05-02 15:37   ` [bug#70460] [PATCH v2 3/3] gnu: services: Add power-profiles-daemon-service-type Dariqq
2024-05-25 13:29     ` Ludovic Courtès
2024-05-25 15:15       ` Dariqq
2024-05-09  8:00   ` [bug#70460] [PATCH v2 0/3] Update power-profiles-daemon and add a service-type for it Dariqq
2024-05-16  6:55   ` bug#70460: " Christopher Baines

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).