From patchwork Wed Jun 29 21:05:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Reily Siegel X-Patchwork-Id: 40596 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 7C26427BBEA; Thu, 7 Jul 2022 16:35:04 +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 AD5F527BBE9 for ; Thu, 7 Jul 2022 16:35:03 +0100 (BST) Received: from localhost ([::1]:49738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9TWw-0001cd-P7 for patchwork@mira.cbaines.net; Thu, 07 Jul 2022 11:35:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9TVy-00084S-A0 for guix-patches@gnu.org; Thu, 07 Jul 2022 11:34:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o9TVy-0000hq-0l for guix-patches@gnu.org; Thu, 07 Jul 2022 11:34:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o9TVx-0006a3-SJ for guix-patches@gnu.org; Thu, 07 Jul 2022 11:34:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56439] [PATCH] gnu: home: Add Guix channels service. Resent-From: Reily Siegel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 07 Jul 2022 15:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56439 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56439@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165720803725281 (code B ref -1); Thu, 07 Jul 2022 15:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jul 2022 15:33:57 +0000 Received: from localhost ([127.0.0.1]:57656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9TVs-0006Zg-Vq for submit@debbugs.gnu.org; Thu, 07 Jul 2022 11:33:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:43182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9TVr-0006ZY-4A for submit@debbugs.gnu.org; Thu, 07 Jul 2022 11:33:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9TVq-0007yZ-Hv for guix-patches@gnu.org; Thu, 07 Jul 2022 11:33:54 -0400 Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:55206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1o9TVl-0000ek-GF for guix-patches@gnu.org; Thu, 07 Jul 2022 11:33:54 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Lf0n161LCz9sq1 for ; Thu, 7 Jul 2022 17:33:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reilysiegel.com; s=MBO0001; t=1657208021; h=from:from: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; bh=IvGK+2bRDHBu+bFTYkTq7ougQKQ9iu0NAFY52V1FZ0Q=; b=gl30O15UXQo0JAzQcSW4Uk5yeNS5HqMHgl7lbyInpd4FhW7Vyu8Dq+BEavyTveUZDODUe2 wX0ogSg2wRIBhhCktJtdCX3Nrfj1y3eBh0DoIuBfFDEJ/PjfrmibtoomIbo4PUr2N16mbW eiqu8vkUfw3z32lDnvLsrRqHZzzJEVGpkXDRjM0/a0R9aQKlFEYFKLrn/HX5XL1/omGROG uNRR162hS/8O+huxDrqiEA5Hm4XCghoFc8nHB7hMZX7RckE3bTHacGJhU9/7PNt+ZxMvVO WXe3T4WsSOK73Zvpq3HSaqgoB3mR9ziymdE0V1jRSYlyXgVNUSj7lf4WVc2FLg== From: Reily Siegel Date: Wed, 29 Jun 2022 17:05:26 -0400 Message-ID: <87let52b07.fsf@reilysiegel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Lf0n161LCz9sq1 Received-SPF: pass client-ip=2001:67c:2050:0:465::101; envelope-from=mail@reilysiegel.com; helo=mout-p-101.mailbox.org X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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 * 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. --- doc/guix.texi | 32 +++++++++++++++++++++++++++ gnu/home/services/guix.scm | 44 ++++++++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + 3 files changed, 77 insertions(+) create mode 100644 gnu/home/services/guix.scm diff --git a/doc/guix.texi b/doc/guix.texi index 097e4a362b..b8b3f5cd82 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -105,6 +105,7 @@ Copyright @copyright{} 2022 Aleksandr Vityazev@* Copyright @copyright{} 2022 Philip M@sup{c}Grath@* Copyright @copyright{} 2022 Karl Hallsby@* Copyright @copyright{} 2022 Justin Veilleux@* +Copyright @copyright{} 2022 Reily Siegel@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -39433,6 +39434,7 @@ services)}. * Shepherd: Shepherd Home Service. Managing User's Daemons. * SSH: Secure Shell. Setting up the secure shell client. * Desktop: Desktop Home Services. Services for graphical environments. +* Guix: Guix Home Services. Services for Guix. @end menu @c In addition to that Home Services can provide @@ -40073,6 +40075,36 @@ format. @end deftp +@node Guix Home Services +@subsection Guix Home Services + +The @code{(gnu home services guix)} module provides services for +user-specific Guix configuraton. + +@defvr {Scheme Variable} home-channels-service-type +This is the service type for managing +@file{$XGG_CONFIG_HOME/guix/channels.scm}, the file which controlls the +channels recived on @command{guix pull}. It's 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 +Additional Channels} and @ref{Using a Custom Guix Channel} for more +details. + +A typical extension for adding a channel might look like this: + +@lisp +(simple-service 'variant-pacakges-service + home-channels-service-type + (list + (channel + (name 'variant-packages) + (url "https://example.org/variant-packages.git"))) +@end lisp +@end defvr @node Invoking guix home @section Invoking @code{guix home} diff --git a/gnu/home/services/guix.scm b/gnu/home/services/guix.scm new file mode 100644 index 0000000000..428daff1c4 --- /dev/null +++ b/gnu/home/services/guix.scm @@ -0,0 +1,44 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Reily Siegel +;;; +;;; 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 home services guix) + #:use-module (gnu home services) + #:use-module (guix channels) + #:use-module (guix gexp) + #:use-module (ice-9 pretty-print) + #:use-module (srfi srfi-1) + #:export (home-channels-service-type)) + +(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))))))) + +(define home-channels-service-type + (service-type + (name 'home-channels) + (default-value %default-channels) + (compose concatenate) + (extend append) + (extensions + (list (service-extension home-xdg-configuration-files-service-type + channels-xdg-files))) + (description "Manages $XDG_CONFIG_HOME/guix/channels.scm"))) diff --git a/gnu/local.mk b/gnu/local.mk index faad6cc6b2..65891cb8ea 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -83,6 +83,7 @@ GNU_SYSTEM_MODULES = \ %D%/home/services/desktop.scm \ %D%/home/services/symlink-manager.scm \ %D%/home/services/fontutils.scm \ + %D%/home/services/guix.scm \ %D%/home/services/shells.scm \ %D%/home/services/shepherd.scm \ %D%/home/services/ssh.scm \