From: matias_jose_seco@autoproduzioni.net
To: guix-devel@gnu.org
Subject: Re: Of sounds and locales
Date: Sat, 24 Oct 2015 15:28:52 +0000 [thread overview]
Message-ID: <d65c68e101107a33138ffabec426d7e1@autoproduzioni.net> (raw)
In-Reply-To: <87twsp47bm.fsf@netris.org>
[-- Attachment #1: Type: text/plain, Size: 3639 bytes --]
As always destiny seems to challenge our will to reach the peak!
> Another option to reduce the whistle is to run "powertop --auto-tune"
> after boot. Here's a service definition I put into my OS config to
> do this:
>
> --8<---------------cut here---------------start------------->8---
> (define (powertop-auto-tune-service)
> (let ((powertop #~(string-append #$powertop "/sbin/powertop")))
> (with-monad %store-monad
> (return
> (service
> (documentation "Run powertop --auto-tune.")
> (provision '(powertop-auto-tune))
> (requirement '(user-processes))
> (start #~(lambda _
> (zero? (system* #$powertop "--auto-tune")))))))))
> --8<---------------cut here---------------end--------------->8---
>
> And then include (powertop-auto-tune-service) in the 'services' field.
> Note, you'll need to import some extra modules at the top of the file:
>
> --8<---------------cut here---------------start------------->8---
> (use-modules (gnu)
> (gnu services)
> (guix gexp)
> (guix store)
> (guix monads))
> --8<---------------cut here---------------end--------------->8---
>
> [...]
>
> My workaround was to add another service that disables the
> second CPU core when it gets too hot. Here's the service definition I
> used:
>
> --8<---------------cut here---------------start------------->8---
> (define (temperature-regulation-service)
> (with-monad %store-monad
> (return
> (service
> (documentation "Regulate temperature on an overclocked Libreboot
> X60.")
> (provision '(temperature-regulation))
> (requirement '(user-processes))
> (start #~(lambda _
> (let ((pid (primitive-fork)))
> (if (positive? pid)
> pid
> (let ()
> (define (current-temp)
> (call-with-input-file
> "/sys/class/thermal/thermal_zone0/temp"
> read))
> (define (set-cpu1-online! online?)
> (call-with-output-file
> "/sys/devices/system/cpu/cpu1/online"
> (lambda (port)
> (write (if online? 1 0) port))))
> (let loop ()
> (let ((temp (current-temp)))
> (cond ((< temp 88000) (set-cpu1-online!
> #t))
> ((> temp 92000) (set-cpu1-online!
> #f))))
> (sleep 2)
> (loop)))))))
> (stop #~(make-kill-destructor))
> (respawn? #t)))))
> --8<---------------cut here---------------end--------------->8---
>
> and as above, you'll need to add (temperature-regulation-service) to
> the
> services field, and of course run "guix system reconfigure <OS-CONFIG>"
> and reboot.
>
Should i add (define (temperature-regulation-service)...
and (define (powertop-auto-tune-service)...
inside (operating-system) definition ?
Actually "sudo guix system reconfigure /etc/config_20151024_B.scm"
returns "/etc/config_20151024_B.scm:10:0: error: source expression
failed to match any pattern".
I've attached my config file for details". Where am i mistaking ?
Note: as you can see i defined locale de_DE.utf8: if i redefine it to
en_GB.utf8, does 'system reconfigure' will update my locales ?
I'm actually planning to properly learn Scheme to correct this things
autonomosly"
Thanks for reading!
[-- Attachment #2: config_20151024_B.scm --]
[-- Type: application/x-elc, Size: 2870 bytes --]
next prev parent reply other threads:[~2015-10-24 15:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-15 20:08 Of sounds and locales matias_jose_seco
2015-07-16 10:59 ` Alex Kost
2015-07-16 23:16 ` Ludovic Courtès
2015-07-27 18:21 ` matias_jose_seco
2015-07-27 21:30 ` Mark H Weaver
2015-07-27 21:39 ` Mark H Weaver
2015-10-24 15:28 ` matias_jose_seco [this message]
2015-10-25 19:07 ` Alex Kost
2015-11-01 22:26 ` matias_jose_seco
2015-11-02 9:01 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d65c68e101107a33138ffabec426d7e1@autoproduzioni.net \
--to=matias_jose_seco@autoproduzioni.net \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).