aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tw/system/cern.scm29
1 files changed, 21 insertions, 8 deletions
diff --git a/tw/system/cern.scm b/tw/system/cern.scm
index 0c05b822..fb767213 100644
--- a/tw/system/cern.scm
+++ b/tw/system/cern.scm
@@ -17,7 +17,8 @@
mtools pulseaudio search shells wm xorg)
(use-service-modules admin authentication avahi base cups dbus desktop docker
- kerberos linux mcron networking pm ssh syncthing vpn xorg)
+ kerberos linux mcron networking pm shepherd ssh syncthing
+ vpn xorg)
(define efi-system-partition ; /dev/nvme0n1p1
(uuid "806A-2762" 'fat))
@@ -166,13 +167,25 @@
(kdc "cerndc.cern.ch"))))))
;; At high CPU frequencies, the fan is very loud, starting around 3.5 GHz.
- (service tlp-service-type
- (tlp-configuration
- (energy-perf-policy-on-ac "balance_power")
- (cpu-scaling-governor-on-ac '("powersave"))
- (cpu-scaling-max-freq-on-ac 3600000) ; kHz
- (cpu-boost-on-ac? #f)
- (sched-powersave-on-ac? #t)))
+ (simple-service 'cpufreq shepherd-root-service-type
+ (list (shepherd-service
+ (documentation "Limit CPU frequency")
+ (provision '(cpufreq))
+ (one-shot? #t)
+ (start #~(make-system-constructor
+ #$(file-append cpupower "/bin/cpupower")
+ " frequency-set --max 3.6GHz"))
+ (stop #~(make-system-constructor
+ #$(file-append cpupower "/bin/cpupower")
+ " frequency-set --max 4.8GHz"))
+ (actions
+ (list (shepherd-action
+ (name 'current)
+ (documentation "Show the current CPU frequencies.")
+ (procedure
+ #~(lambda _
+ (system* #$(file-append cpupower "/bin/cpupower")
+ "frequency-info")))))))))
(service thermald-service-type
(thermald-configuration