From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id Hxb7Ov+BgmFGQAAAgWs5BA (envelope-from ) for ; Wed, 03 Nov 2021 13:35:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id INkHNv+BgmFLGAAAbx9fmQ (envelope-from ) for ; Wed, 03 Nov 2021 12:35:11 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9EC6DCA16 for ; Wed, 3 Nov 2021 13:35:11 +0100 (CET) Received: from localhost ([::1]:41496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miFTy-00057s-Lf for larch@yhetil.org; Wed, 03 Nov 2021 08:35:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47738) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miFTq-00050J-C1 for guix-patches@gnu.org; Wed, 03 Nov 2021 08:35:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miFTq-0002FQ-3v for guix-patches@gnu.org; Wed, 03 Nov 2021 08:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1miFTp-0007Pm-T9 for guix-patches@gnu.org; Wed, 03 Nov 2021 08:35:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#45105] [PATCH v2] gnu: Add mbpfan service. References: <87a6ups6pd.fsf@posteo.net> In-Reply-To: <87a6ups6pd.fsf@posteo.net> Resent-From: phodina Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 03 Nov 2021 12:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45105 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "45105@debbugs.gnu.org" <45105@debbugs.gnu.org> Received: via spool by 45105-submit@debbugs.gnu.org id=B45105.163594286028444 (code B ref 45105); Wed, 03 Nov 2021 12:35:01 +0000 Received: (at 45105) by debbugs.gnu.org; 3 Nov 2021 12:34:20 +0000 Received: from localhost ([127.0.0.1]:39404 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miFTA-0007Oi-7R for submit@debbugs.gnu.org; Wed, 03 Nov 2021 08:34:20 -0400 Received: from mail-40133.protonmail.ch ([185.70.40.133]:17749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miFT7-0007OR-FH for 45105@debbugs.gnu.org; Wed, 03 Nov 2021 08:34:19 -0400 Date: Wed, 03 Nov 2021 12:34:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1635942846; bh=TDA2QBUnlSdjoQHUZtODvLDIMqkDuL+pYdB0HHz+hGs=; h=Date:To:From:Reply-To:Subject:From; b=TuExbT9YHOVbvpoBAwkMuvv9EAABGw9lOENPjUuDhoXOyOTs91aoTNmC+jEtH3YGj wSjxTzlEqIKggALFt/+y4RemXgQMRhtHRknatJTATQj87EU97RwRxYCdM9/9Ig/oC2 xj4/F3daXuSHqIZk9lR5exGboV4/TQx4/e+5KeS4= Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: phodina X-ACL-Warn: , phodina via Guix-patches From: phodina via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635942911; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=TDA2QBUnlSdjoQHUZtODvLDIMqkDuL+pYdB0HHz+hGs=; b=lGK1iqXqfO1dAIpxX8Q9DH6eKQptFm2U+efH3Zd7ZeNCEBD7BovbOjDqbqcpxZ/3c2GQ8r GDU0stPvl2G5OmpTH9ZNeUQnvH3xQq99LByy7/hSUI8cFnV3S+hyW+MN6bWKf74dexu4ji N3t+uiVFTC05S0T/fckGs2oR7ZeXIVN/3aXVIn2/Dn6jBdJcvlU38GDfGiIMNMIoTsZyp/ +LZTjweunkVAqJw3eTE8CsgNeqs3kcwLgYI84o1rsc4Lpo/x1KeYvzCp+7MCrYBcjXi1dp 6ehcSdTUkdkmvapn+jvYDbgFZYX8S/gfX8ClAFGmEmM73qML7Tu9OiyLfDddPw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635942911; a=rsa-sha256; cv=none; b=ChzvGVQZ8EJsmUDmUGgvhG9FTntBCqg96+8m2C++DxruEqbjZu/8+MMdYgIxhsJiODOBW3 hj3unZnSQ+7EysFAxNoFr6WTufsVspCqXBud9pGg92jXWl+WZsZ6bl24KgmH5oz705VnJE 9gFZQTEyScstq/WBZa4HAd8lcxzulWE+18s+atRWXKTyLuf2C8bUA44CaNKEb/4yGLzaIn XpwgrJSFTTbcwPL8CJUMFMNiTpn0qA9RO8OQ0ZZMyVaQNrjgikFXIFjn69mH7C5hRXjtKS W45QwQXuH8iI4gcLKowdyyYotIXtIaSyyQ4TRkr+CrampVrABJxXhqhB5OKP6A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail header.b=TuExbT9Y; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=protonmail.com header.s=protonmail header.b=TuExbT9Y; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 9EC6DCA16 X-Spam-Score: -2.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: y7alQhdpJ7zh Hi Mathieu, here are the changes. I don't have Apple laptop, so I can't tests the servi= ce. Petr * gnu/services/mbpfan.scm (mbpfan service): New variable. --8<---------------cut here---------------start------------->8--- diff --git a/gnu/services/mbpfan.scm b/gnu/services/mbpfan.scm new file mode 100644 index 0000000000..493ca70bb7 --- /dev/null +++ b/gnu/services/mbpfan.scm @@ -0,0 +1,72 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright =C2=A9 2020 Niklas Eklund +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services mbpfan) + #:use-module (gnu packages linux) + #:use-module (gnu services) + #:use-module (gnu services base) + #:use-module (gnu services shepherd) + #:use-module (guix gexp) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (ice-9 format) + #:use-module (guix modules) + #:export (mbpfan-service-type + + mbpfan-configuration + mbpfan-configuration?)) + +;;; Commentary: +;;; +;;; This module provides a service definition for the mbpfan. +;;; +;;; Code: + +(define-record-type* + mbpfan-configuration make-mbpfan-configuration + mbpfan-configuration? + (log-file mbpfan-configuration-log-file ;string + (default "/var/log/mbpfan.log")) + (verbose? mbpfan-configuration-verbose? (default #f))) + +(define mbpfan-shepherd-service + (match-lambda + (($ log-file verbose?) + (list + (shepherd-service + (documentation "Run the mbpfan daemon.") + (provision '(mbpfan)) + (requirement '(syslogd)) + (start #~(make-forkexec-constructor + (list #$(file-append mbpfan "/sbin/mbpfan") + "-f" + #$@(if verbose? + '("-v") ; verbose logging + '())) + #:log-file #$log-file)) + (stop #~(make-kill-destructor))))))) + +(define mbpfan-service-type + (service-type + (name 'mbpfan) + (extensions + (list (service-extension shepherd-root-service-type + mbpfan-shepherd-service))) + (description + "Run the MacBook/Macbook Pro fan daemon.") + (default-value (mbpfan-configuration)))) -- 2.33.1