diff mbox series

[bug#68012] thinkfan-service-type: Add thinkfan entry to thinkfan-configuration.

Message ID ed8a1cc6dad7fa297e3ce08171cad361@disroot.org
State New
Headers show
Series [bug#68012] thinkfan-service-type: Add thinkfan entry to thinkfan-configuration. | expand

Commit Message

vasilii.smirnov--- via Guix-patches" via Dec. 27, 2023, 5:04 p.m. UTC

Comments

Josselin Poiret Jan. 13, 2024, 4:31 p.m. UTC | #1
lgcoelho--- via Guix-patches via <guix-patches@gnu.org> writes:

>  (define-configuration/no-serialization thinkfan-configuration
> +  (thinkfan
> +   (package thinkfan)
> +   "Thinkfan package to be used.")
>    (pid-file
>     (string "/var/run/thinkfan.pid")
>     "Where to store the PID file.")
> @@ -491,17 +494,16 @@ (define-configuration/no-serialization thinkfan-configuration
>  
>  (define thinkfan-shepherd-service
>    (match-record-lambda <thinkfan-configuration>
> -    (pid-file config-file log-file extra-options)
> +    (thinkfan pid-file config-file log-file extra-options)
>      (list (shepherd-service
>             (provision '(thinkfan))
>             (documentation
>              "Adjust fan level according to configured temperature limits.")
>             (requirement '(user-processes))
>             (start #~(make-forkexec-constructor
> -                      (list (string-append #$thinkfan-next
> -                                           "/sbin/thinkfan")
> -                             "-n" #$@extra-options
> -                             "-c" #$config-file)
> +                      (list (string-append #$thinkfan "/sbin/thinkfan")
> +                                           "-n" #$@extra-options
> +                                           "-c" #$config-file)

That's a good idea, but can you squash this with the first commit?

Best,
diff mbox series

Patch

From ff38662f5d5512b2f656cd3daed9c3ee32cd60ae Mon Sep 17 00:00:00 2001
From: Luis Guilherme Coelho <lgcoelho@disroot.org>
Date: Wed, 27 Dec 2023 14:02:04 -0300
Subject: [PATCH 3/3] thinkfan-service-type: Add thinkfan entry to
 thinkfan-configuration

---
 gnu/services/pm.scm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/gnu/services/pm.scm b/gnu/services/pm.scm
index 2d02476d20..5b96d4265a 100644
--- a/gnu/services/pm.scm
+++ b/gnu/services/pm.scm
@@ -475,6 +475,9 @@  (define (string-or-file-like? x)
       (file-like? x)))
 
 (define-configuration/no-serialization thinkfan-configuration
+  (thinkfan
+   (package thinkfan)
+   "Thinkfan package to be used.")
   (pid-file
    (string "/var/run/thinkfan.pid")
    "Where to store the PID file.")
@@ -491,17 +494,16 @@  (define-configuration/no-serialization thinkfan-configuration
 
 (define thinkfan-shepherd-service
   (match-record-lambda <thinkfan-configuration>
-    (pid-file config-file log-file extra-options)
+    (thinkfan pid-file config-file log-file extra-options)
     (list (shepherd-service
            (provision '(thinkfan))
            (documentation
             "Adjust fan level according to configured temperature limits.")
            (requirement '(user-processes))
            (start #~(make-forkexec-constructor
-                      (list (string-append #$thinkfan-next
-                                           "/sbin/thinkfan")
-                             "-n" #$@extra-options
-                             "-c" #$config-file)
+                      (list (string-append #$thinkfan "/sbin/thinkfan")
+                                           "-n" #$@extra-options
+                                           "-c" #$config-file)
                      #:log-file #$log-file
                      #:pid-file #$pid-file))
            (stop #~(make-kill-destructor))
-- 
2.41.0