From patchwork Mon Jul 11 22:07:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 40626 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 409E027BBEA; Mon, 11 Jul 2022 23:08:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 E412727BBE9 for ; Mon, 11 Jul 2022 23:08:13 +0100 (BST) Received: from localhost ([::1]:33498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oB1Zd-0000eV-3P for patchwork@mira.cbaines.net; Mon, 11 Jul 2022 18:08:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52300) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oB1ZS-0000WN-BE for guix-patches@gnu.org; Mon, 11 Jul 2022 18:08:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47264) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oB1ZS-0003X1-1Z for guix-patches@gnu.org; Mon, 11 Jul 2022 18:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oB1ZR-0004YO-SQ for guix-patches@gnu.org; Mon, 11 Jul 2022 18:08:01 -0400 Subject: bug#56439: [PATCH] gnu: home: Add Guix channels service. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Mon, 11 Jul 2022 22:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 56439 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Reily Siegel Cc: 56439-done@debbugs.gnu.org Mail-Followup-To: 56439@debbugs.gnu.org, ludo@gnu.org, mail@reilysiegel.com Received: via spool by 56439-done@debbugs.gnu.org id=D56439.165757726717477 (code D ref 56439); Mon, 11 Jul 2022 22:08:01 +0000 Received: (at 56439-done) by debbugs.gnu.org; 11 Jul 2022 22:07:47 +0000 Received: from localhost ([127.0.0.1]:41160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oB1ZC-0004Xo-O6 for submit@debbugs.gnu.org; Mon, 11 Jul 2022 18:07:47 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oB1ZB-0004Xa-IY for 56439-done@debbugs.gnu.org; Mon, 11 Jul 2022 18:07:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:59634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oB1Z6-0003VU-C1; Mon, 11 Jul 2022 18:07:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=UGB8d6BFwf4CgUfnz06+V5noQ/EsWkiiUc8Bb5B/2cc=; b=khp/SIF34LV0EMs3nRcZ yljmL4K/6Jp3RR4/LXP9GKCZHrfESFVaFbMSYwgb+h+08bE1fGMxzwaULgTXr3VGK/tl9TbzQ9fK6 fPpMeFtR6Endod9ai6ilkeLFZCrdGsE/BhDy66p2pr+mZP2PQlQiLpyyLmwwCqsmzGEPovV0GaTP2 u27DD4TtsJ/g7BaZSfUXtbYuUradfLBUDX5pZEsuYfcm1dtAO3evqkphqwBhQmguB7vM6C6F2XOs1 mTgkzSCcXTiQznw/lQgqo7t1kvyg2zM/9alTv0N1SNfzSZ1U1xMUUpihDlhZRk1HdTBqZLy8D9Eml CaEBwvC+MYxt2g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56996 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oB1Z5-0007fm-Ra; Mon, 11 Jul 2022 18:07:40 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <87let52b07.fsf@reilysiegel.com> <87v8s3n6pj.fsf@reilysiegel.com> Date: Tue, 12 Jul 2022 00:07:38 +0200 In-Reply-To: <87v8s3n6pj.fsf@reilysiegel.com> (Reily Siegel's message of "Wed, 29 Jun 2022 17:05:26 -0400") Message-ID: <87h73ni9qt.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 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" X-getmail-retrieved-from-mailbox: Patches Hi, Reily Siegel skribis: > * gnu/home/services/guix.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add guix.scm. > * doc/guix.texi: Add documentation for home-channels-service. Neat! Applied with the cosmetic changes below. > +(define (channels-xdg-files channels) > + `(("guix/channels.scm" > + ,(plain-file > + "channels.scm" > + (call-with-output-string > + (lambda (port) > + (pretty-print (cons 'list (map channel->code channels)) port))))))) The downside with this approach is that it doesn’t let you have a sophisticated ‘channels.scm’ file, for instance one that calls ‘channel-with-substitutes-available’ (info "(guix) Channels with Substitutes"). All in all, I think that’s an acceptable limitation. Someone willing to write arbitrary code to ‘channels.scm’ can “roll their own” and extend ‘home-xdg-configuration-files-service-type’ similarly. Thanks, Ludo’. diff --git a/doc/guix.texi b/doc/guix.texi index 1f49d9bd6a..637a2cf744 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -40083,14 +40083,14 @@ user-specific Guix configuration. @defvr {Scheme Variable} home-channels-service-type This is the service type for managing -@file{$XGG_CONFIG_HOME/guix/channels.scm}, the file which controls the -channels recieved on @command{guix pull}. Its associated value is a list +@file{$XDG_CONFIG_HOME/guix/channels.scm}, the file that controls the +channels recieved on @command{guix pull}. Its associated value is a list of @code{channel} records, defined in the @code{(guix channels)} module. Generally, it is better to extend this service than to directly configure it, as its default value is the default guix channel(s) defined by @code{%default-channels}. If you configure this service -directly, be sure to include a guix channel. See @ref{Specifying +directly, be sure to include a guix channel. @xref{Specifying Additional Channels} and @ref{Using a Custom Guix Channel} for more details.