From patchwork Wed Jan 15 16:52:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Z572 X-Patchwork-Id: 37074 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 56CA827BBEC; Wed, 15 Jan 2025 16:53:42 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4E22D27BBE2 for ; Wed, 15 Jan 2025 16:53:39 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tY6dm-00013Q-Ag; Wed, 15 Jan 2025 11:53:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tY6df-00012z-Ql for guix-patches@gnu.org; Wed, 15 Jan 2025 11:53:07 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tY6db-0003hn-Em for guix-patches@gnu.org; Wed, 15 Jan 2025 11:53:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=QoSFfs/6KoXveB2gFqbZakCA2qc6dgRcfp2S5e4VKHo=; b=ncfiq0xEZWuTPVIVJJbJN2nT0CubdHXbm4PO+eBtM8F71PPtaw0N4REvMhSrzwFkNSBMRbNzp6wwBUUMdarYcZVh+v7DeuP5ZV7OfqoSMq1/mYQozZKmrpsxMzieNDFjX81p3YAekU/ybErlcjVhkDb50ULoYGZY1MbVZInQQUOjW9bt1ivTOxfna/4DFWICONvp/MUl39/FnYVSKxTbL3OHeP2Foi929XiqCPLmcchJxJiJS0OdoX7TewqY0sVAs79NKnko0lXGnWBiw4CuioKdcrq2y/+jSbDq1GYTN3IoVYWAL/equstZhd/wtkoXlfrSvUr0VrdW41p9k/ltCg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tY6db-0001xL-3X for guix-patches@gnu.org; Wed, 15 Jan 2025 11:53:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75159] [PATCH v2 3/3] services: Add corectrl-helper-service-type. Resent-From: Zheng Junjie Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Jan 2025 16:53:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75159 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ashvith Shetty Cc: 75159@debbugs.gnu.org Received: via spool by 75159-submit@debbugs.gnu.org id=B75159.17369599827505 (code B ref 75159); Wed, 15 Jan 2025 16:53:03 +0000 Received: (at 75159) by debbugs.gnu.org; 15 Jan 2025 16:53:02 +0000 Received: from localhost ([127.0.0.1]:58527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tY6dU-0001wk-9V for submit@debbugs.gnu.org; Wed, 15 Jan 2025 11:53:02 -0500 Received: from smtp84.cstnet.cn ([159.226.251.84]:53032 helo=cstnet.cn) by debbugs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1tY6dP-0001wP-EZ for 75159@debbugs.gnu.org; Wed, 15 Jan 2025 11:52:54 -0500 Received: from m (unknown [107.174.64.25]) by APP-05 (Coremail) with SMTP id zQCowADX36PQ54dnKppbBw--.23799S2; Thu, 16 Jan 2025 00:52:36 +0800 (CST) From: Zheng Junjie In-Reply-To: <20241231181027.28121-5-ashvithshetty10@gmail.com> (Ashvith Shetty's message of "Tue, 31 Dec 2024 23:39:49 +0530") References: <20241231181027.28121-2-ashvithshetty10@gmail.com> <20241231181027.28121-5-ashvithshetty10@gmail.com> User-Agent: mu4e 1.12.7; emacs 30.0.92 Date: Thu, 16 Jan 2025 00:52:26 +0800 Message-ID: <87ikqg2f5h.fsf@iscas.ac.cn> MIME-Version: 1.0 X-CM-TRANSID: zQCowADX36PQ54dnKppbBw--.23799S2 X-Coremail-Antispam: 1UD129KBjvJXoWxZr1xuFWfKFWDZw4DWrWktFb_yoWruw4kpF 17WF4fKr17tF1fWws3XF1DK3y3W392gr45urnrWF1UAr45Ar92yr43K3y3WFs7Ar1Fqr45 XrWftFn0934UArJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvvb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVWUJVW8JwA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_Jr0_Gr1lnx0Ee4C267I2x7xF54xIwI0E7I0Y6sxI4wAS0I0E0xvY zxvE52x082IY62kv0487M2AExVA0xI801c8C04v7Mc02F40EFcxC0VAKzVAqx4xG6I80ew Av7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY 6r1j6r4UM4x0Y48IcVAKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r 4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF 67AKxVWUXVWUAwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2I x0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2 z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIYCTnIWIevJa73Uj IFyTuYvjxU6cdbDUUUU X-Originating-IP: [107.174.64.25] X-CM-SenderInfo: x2kh0wxmxqyx3h6l2u1dvotugofq/ 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Ashvith Shetty writes: > From: Ashvith Shetty > > * gnu/services/admin.scm: New file. > (corectrl-helper-service-type): new variable. > * gnu/local.mk: Add them. > * doc/guix.texi (Miscellaneous Services): Document it. > --- > doc/guix.texi | 32 ++++++++++++++++++++++++++++++++ > gnu/services/admin.scm | 27 ++++++++++++++++++++++++++- > 2 files changed, 58 insertions(+), 1 deletion(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 924f13f0f6..9330525c61 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -135,6 +135,7 @@ Copyright @copyright{} 2024 Nigko Yerden@* > Copyright @copyright{} 2024 Troy Figiel@* > Copyright @copyright{} 2024 Sharlatan Hellseher@* > Copyright @copyright{} 2024 45mg@* > +Copyright @copyright{} 2024 Ashvith Shetty@* > > Permission is granted to copy, distribute and/or modify this document > under the terms of the GNU Free Documentation License, Version 1.3 or > @@ -42590,6 +42591,37 @@ empty list means that no type is specified. > > @end deftp > > +@cindex corectrl-helper > +@subsubheading CoreCtrl Helper Service > + > +The @code{(gnu services admin)} module provides a DBus service for > +interacting with system hardware resources, such as CPU and GPU, > +enabling advanced control and management through the CoreCtrl application. > + > +@defvar corectrl-helper-service-type > +The service type for @command{corectrl}, which provides a helper service. > + > +@lisp > +(service corectrl-helper-service-type) > +@end lisp > +@end defvar > + > + > +@deftp {Data Type} corectrl-helper-configuration > +This is the data type representing the configuration of corectrl-helper. > + > +@table @asis > +@item @code{corectrl} (default: @code{corectrl}) (type: package) > + > +The @command{corectrl} executable to use. > +@end table > +@end deftp > + > +For more details, please read the > +@uref{https://gitlab.com/corectrl/corectrl/-/wikis/Installation, Installation} > +and > +@uref{https://gitlab.com/corectrl/corectrl/-/wikis/Setup, Setup} wiki pages. > + > @c %end of fragment > > @node Privileged Programs > diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm > index 571af6a04e..42cefdf256 100644 > --- a/gnu/services/admin.scm > +++ b/gnu/services/admin.scm > @@ -5,6 +5,7 @@ > ;;; Copyright © 2023 Giacomo Leidi > ;;; Copyright © 2024 Gabriel Wicki > ;;; Copyright © 2024 Richard Sent > +;;; Copyright © 2024 Ashvith Shetty > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -33,6 +34,7 @@ (define-module (gnu services admin) > #:use-module (gnu packages linux) > #:use-module (gnu services) > #:use-module (gnu services configuration) > + #:use-module (gnu services dbus) > #:use-module (gnu services mcron) > #:use-module (gnu services shepherd) > #:use-module (gnu system accounts) > @@ -108,7 +110,11 @@ (define-module (gnu services admin) > resize-file-system-configuration-cloud-utils > resize-file-system-configuration-e2fsprogs > resize-file-system-configuration-btrfs-progs > - resize-file-system-configuration-bcachefs-tools)) > + resize-file-system-configuration-bcachefs-tools > + > + corectrl-helper-service-type > + corectrl-helper-configuration > + corectrl-helper-configuration?)) > > ;;; Commentary: > ;;; > @@ -679,4 +685,23 @@ (define resize-file-system-service-type > (service-extension shepherd-root-service-type > (compose list resize-file-system-shepherd-service)))))) > > +;;; > +;;; CoreCtrl helper service. > +;;; > + > +(define-configuration corectrl-helper-configuration > + (corectrl (file-like corectrl) "The corectrl package")) > + > +(define (corectrl-helper-dbus-service config) > + (list (corectrl-helper-configuration-corectrl config))) > + > +(define corectrl-helper-service-type > + (service-type (name 'corectrl-helper) > + (extensions (list (service-extension dbus-root-service-type > + corectrl-helper-dbus-service) > + (service-extension polkit-service-type > + corectrl-helper-dbus-service))) > + (default-value (corectrl-helper-configuration)) > + (description "Run corectrl-helper, an essential service for the corectrl application."))) > + > ;;; admin.scm ends here I think it's better this way, I am not good at how to write the document and description, may you modify it? From 7ce5d94bf29d5877449345651ff7fcff921778cd Mon Sep 17 00:00:00 2001 Message-ID: <7ce5d94bf29d5877449345651ff7fcff921778cd.1736958803.git.zhengjunjie@iscas.ac.cn> From: Ashvith Shetty Date: Wed, 15 Jan 2025 23:08:48 +0800 Subject: [PATCH] gnu: services: Add corectrl-service-type. * gnu/services/admin.scm: (corectrl-service-type): new variable. * doc/guix.texi (Miscellaneous Services): Document it. Change-Id: If7df1e67b227b86bcf827be28c35181128579589 --- doc/guix.texi | 27 +++++++++++++++++++++ gnu/local.mk | 1 + gnu/services/corectrl.scm | 51 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 gnu/services/corectrl.scm diff --git a/doc/guix.texi b/doc/guix.texi index 3cf1fedc301..a6d1256361f 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -136,6 +136,7 @@ Copyright @copyright{} 2024 Sharlatan Hellseher@* Copyright @copyright{} 2024 45mg@* Copyright @copyright{} 2025 Sören Tempel@* +Copyright @copyright{} 2024 Ashvith Shetty@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -42730,6 +42731,32 @@ Miscellaneous Services @end deftp +@cindex corectrl +@subsubheading CoreCtrl Service + +The @code{(gnu services corectrl)} module provides a DBus service for +interacting with system hardware resources, such as CPU and GPU, +enabling advanced control and management through the CoreCtrl application. + +@defvar corectrl-service-type +The service type for @command{corectrl}, which provides a service. + +@lisp +(service corectrl-service-type) +@end lisp +@end defvar + + +@deftp {Data Type} corectrl-configuration +This is the data type representing the configuration of corectrl. + +@table @asis +@item @code{package} (default: @code{corectrl}) (type: file-like) + +The @command{corectrl} executable to use. +@end table +@end deftp + @c %end of fragment @node Privileged Programs diff --git a/gnu/local.mk b/gnu/local.mk index e0faa1f9fc2..9c41d90ec0e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -726,6 +726,7 @@ GNU_SYSTEM_MODULES = \ %D%/services/backup.scm \ %D%/services/certbot.scm \ %D%/services/cgit.scm \ + %D%/services/corectrl.scm \ %D%/services/ci.scm \ %D%/services/configuration.scm \ %D%/services/containers.scm \ diff --git a/gnu/services/corectrl.scm b/gnu/services/corectrl.scm new file mode 100644 index 00000000000..14d42cd7206 --- /dev/null +++ b/gnu/services/corectrl.scm @@ -0,0 +1,51 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2024 Ashvith Shetty +;;; +;;; 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 corectrl) + #:use-module (gnu packages admin) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu services dbus) + #:use-module (guix gexp) + #:export (corectrl-service-type + corectrl-configuration + corectrl-configuration? + corectrl-configuration-package)) + +;;; +;;; CoreCtrl service. +;;; + +(define-configuration/no-serialization corectrl-configuration + (package (file-like corectrl) "The corectrl package")) + +(define corectrl-service-type + (service-type + (name 'corectrl) + (extensions + (list (service-extension profile-service-type + (compose list corectrl-configuration-package)) + (service-extension dbus-root-service-type + (compose list corectrl-configuration-package)) + (service-extension polkit-service-type + (compose list corectrl-configuration-package)))) + (default-value (corectrl-configuration)) + (description "Run corectrl-helper, an essential service for the corectrl +application."))) + +;;; corectrl.scm ends here base-commit: b696658ee8e0655b17f5d26e024956b5148e36d6 prerequisite-patch-id: 09f39e5f8e208bc1f1f09dfb62f0bdf99415e0da prerequisite-patch-id: 6ca76593d42480b0b7166923064adc0dd15ba822 -- 2.47.1