thinkfan-service-type: Add thinkfan entry to thinkfan-configuration.
parent
fa8a617be6
commit
7e88398dbc
3
buer.scm
3
buer.scm
|
@ -107,7 +107,7 @@
|
|||
#|guile |# guile-3.0-latest guile-colorized guile-readline
|
||||
#|less |# less
|
||||
#|linux |# e2fsprogs eudev fuse iproute kbd kmod lm-sensors procps
|
||||
psmisc thinkfan-next util-linux
|
||||
psmisc util-linux
|
||||
#|man |# man-db mandoc man-pages
|
||||
#|shells |# dash-next
|
||||
#|texinfo |# info-reader
|
||||
|
@ -247,6 +247,7 @@
|
|||
#|Thinkfan services|#
|
||||
(service thinkfan-service-type
|
||||
(thinkfan-configuration
|
||||
(thinkfan thinkfan-next)
|
||||
(config-file file:thinkfan-config)))
|
||||
|
||||
#|Doas configuration services|#
|
||||
|
|
|
@ -1,22 +1,13 @@
|
|||
(define-module (radix services pm)
|
||||
#:use-module (radix packages linux)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu)
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services shepherd)
|
||||
#:use-module (gnu services configuration)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (ice-9 curried-definitions)
|
||||
#:export (thinkfan-configuration
|
||||
make-thinkfan-configuration
|
||||
thinkfan-configuration?
|
||||
|
||||
thinkfan-configuration-pid-file
|
||||
thinkfan-configuration-config-file
|
||||
thinkfan-configuration-log-file
|
||||
thinkfan-configuration-extra-options
|
||||
|
||||
thinkfan-shepherd-service
|
||||
thinkfan-service-type))
|
||||
|
||||
(define (string-or-file-like? x)
|
||||
|
@ -24,6 +15,9 @@
|
|||
(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.")
|
||||
|
@ -40,17 +34,16 @@ arbitrary command-line arguments to ‘thinkfan’ as a list of strings."))
|
|||
|
||||
(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))
|
||||
|
|
Loading…
Reference in New Issue