From mboxrd@z Thu Jan 1 00:00:00 1970 From: matias_jose_seco@autoproduzioni.net Subject: Re: Of sounds and locales Date: Sat, 24 Oct 2015 15:28:52 +0000 Message-ID: References: <725fd1253bc420d3e1e6bfa49bbf9b79@autoproduzioni.net> <87twsp47bm.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_11d0507132351bdf7c7135bdd9d0384e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq0kk-0000r2-8F for guix-devel@gnu.org; Sat, 24 Oct 2015 11:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zq0kg-0001Vn-SU for guix-devel@gnu.org; Sat, 24 Oct 2015 11:29:06 -0400 Received: from contumacia.investici.org ([178.255.144.35]:53619) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zq0kg-0001Vh-Iw for guix-devel@gnu.org; Sat, 24 Oct 2015 11:29:02 -0400 Received: from dissenso.investici.org (dissenso-vpn.investici.org [172.16.1.10]) by contumacia.investici.org (Postfix) with ESMTP id A25AF200431 for ; Sat, 24 Oct 2015 15:28:52 +0000 (UTC) Received: from [209.234.253.196] (dissenso [209.234.253.196]) (Authenticated sender: matias_jose_seco@autoproduzioni.net) by localhost (Postfix) with ESMTPA id 231DB4187C for ; Sat, 24 Oct 2015 15:28:52 +0000 (UTC) In-Reply-To: <87twsp47bm.fsf@netris.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=_11d0507132351bdf7c7135bdd9d0384e Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed 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 " > 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! --=_11d0507132351bdf7c7135bdd9d0384e Content-Transfer-Encoding: base64 Content-Type: application/x-elc; name=config_20151024_B.scm Content-Disposition: attachment; filename=config_20151024_B.scm; size=2870 Cih1c2UtbW9kdWxlcyAoZ251KQogICAgICAgICAgICAgKGdudSBzZXJ2aWNlcykKICAgICAgICAg ICAgIChndWl4IGdleHApCiAgICAgICAgICAgICAoZ3VpeCBzdG9yZSkKICAgICAgICAgICAgIChn dWl4IG1vbmFkcykpCih1c2Utc2VydmljZS1tb2R1bGVzIG5ldHdvcmtpbmcgc3NoKQoodXNlLXBh Y2thZ2UtbW9kdWxlcyBhZG1pbikKCihvcGVyYXRpbmctc3lzdGVtCiAgKGhvc3QtbmFtZSAiYmFh d29ybGQiKQogICh0aW1lem9uZSAiRXVyb3BlL1JvbWUiKQogIChsb2NhbGUgImRlX0RFLnV0Zjgi KQoKICAoYm9vdGxvYWRlciAoZ3J1Yi1jb25maWd1cmF0aW9uIChkZXZpY2UgIi9kZXYvc2RhIikp KQogIChmaWxlLXN5c3RlbXMgKGNvbnMgKGZpbGUtc3lzdGVtCiAgICAgICAgICAgICAgICAgICAg ICAgIChkZXZpY2UgInJvb3QiKQogICAgICAgICAgICAgICAgICAgICAgICAodGl0bGUgJ2xhYmVs KQogICAgICAgICAgICAgICAgICAgICAgICAobW91bnQtcG9pbnQgIi8iKQogICAgICAgICAgICAg ICAgICAgICAgICAodHlwZSAiZXh0NCIpKQogICAgICAgICAgICAgICAgICAgICAgJWJhc2UtZmls ZS1zeXN0ZW1zKSkKCiAgKHN3YXAtZGV2aWNlcyAnKCIvZGV2L3NkYTIiKSkKCiAgKHVzZXJzIChs aXN0ICh1c2VyLWFjY291bnQKICAgICAgICAgICAgICAgIChuYW1lICJtanMiKQogICAgICAgICAg ICAgICAgKGdyb3VwICJ1c2VycyIpCiAgICAgICAgICAgICAgICAoc3Vwc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WlyZW1lbnQgJyh1c2VyLXByb2Nlc3NlcykpCiAgICAgIChzdGFy dCAjfihsYW1iZGEgXwogICAgICAgICAgICAgICAgIChsZXQgKChwaWQgKHByaW1pdGl2ZS1mb3Jr KSkpCiAgICAgICAgICAgICAgICAgICAoaWYgKHBvc2l0aXZlPyBwaWQpCiAgICAgICAgICAgICAg ICAgICAgICAgcGlkCiAgICAgICAgICAgICAgICAgICAgICAgKGxldCAoKQogICAgICAgICAgICAg ICAgICAgICAgICAgKGRlZmluZSAoY3VycmVudC10ZW1wKQogICAgICAgICAgICAgICAgICAgICAg ICAgICAoY2FsbC13aXRoLWlucHV0LWZpbGUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICIvc3lzL2NsYXNzL3RoZXJtYWwvdGhlcm1hbF96b25lMC90ZW1wIgogICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHJlYWQpKQogICAgICAgICAgICAgICAgICAgICAgICAgKGRlZmluZSAoc2V0 LWNwdTEtb25saW5lISBvbmxpbmU/KQogICAgICAgICAgICAgICAgICAgICAgICAgICAoY2FsbC13 aXRoLW91dHB1dC1maWxlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiL3N5cy9kZXZp Y2VzL3N5c3RlbS9jcHUvY3B1MS9vbmxpbmUiCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KGxhbWJkYSAocG9ydCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh3cml0ZSAoaWYg b25saW5lPyAxIDApIHBvcnQpKSkpCiAgICAgICAgICAgICAgICAgICAgICAgICAobGV0IGxvb3Ag KCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxldCAoKHRlbXAgKGN1cnJlbnQtdGVtcCkp KQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25kICgoPCB0ZW1wIDg4MDAwKSAoc2V0 LWNwdTEtb25saW5lISAjdCkpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCg+ IHRlbXAgOTIwMDApIChzZXQtY3B1MS1vbmxpbmUhICNmKSkpKQogICAgICAgICAgICAgICAgICAg ICAgICAgICAoc2xlZXAgMikKICAgICAgICAgICAgICAgICAgICAgICAgICAgKGxvb3ApKSkpKSkp CiAgICAgIChzdG9wICN+KG1ha2Uta2lsbC1kZXN0cnVjdG9yKSkKICAgICAgKHJlc3Bhd24/ICN0 KSkpKSkKCiAgOzsgR2xvYmFsbHktaW5zdGFsbGVkIHBhY2thZ2VzLgogIChwYWNrYWdlcyAoY29u cyB0Y3BkdW1wICViYXNlLXBhY2thZ2VzKSkKCiAgIDs7IFN0YXJ0dXAgc2VydmljZXMKICAoc2Vy dmljZXMgKGNvbnMqICh0ZW1wZXJhdHVyZS1yZWd1bGF0aW9uLXNlcnZpY2UpCiAgICAgICAgICAg ICAgICAgICAocG93ZXJ0b3AtYXV0by10dW5lLXNlcnZpY2UpCiAgICAgICAgICAgICAgICAgICAl YmFzZS1zZXJ2aWNlcykpKQoKCgo= --=_11d0507132351bdf7c7135bdd9d0384e--