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: 40623 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 A95D827BBEA; Mon, 11 Jul 2022 14:11:40 +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 11E7427BBE9 for ; Mon, 11 Jul 2022 14:11:40 +0100 (BST) Received: from localhost ([::1]:48108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAtCN-0004v6-75 for patchwork@mira.cbaines.net; Mon, 11 Jul 2022 09:11:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAt19-0002Pt-Gg for guix-patches@gnu.org; Mon, 11 Jul 2022 09:00:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAt19-0000Su-3Z for guix-patches@gnu.org; Mon, 11 Jul 2022 09:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oAt19-00057d-1u for guix-patches@gnu.org; Mon, 11 Jul 2022 09:00:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56439] [PATCH v2] gnu: home: Add Guix channels service. References: <87let52b07.fsf@reilysiegel.com> In-Reply-To: <87let52b07.fsf@reilysiegel.com> Resent-From: Reily Siegel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 11 Jul 2022 13:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56439 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56439@debbugs.gnu.org Received: via spool by 56439-submit@debbugs.gnu.org id=B56439.165754434919583 (code B ref 56439); Mon, 11 Jul 2022 13:00:02 +0000 Received: (at 56439) by debbugs.gnu.org; 11 Jul 2022 12:59:09 +0000 Received: from localhost ([127.0.0.1]:38781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oAt0H-00055i-4T for submit@debbugs.gnu.org; Mon, 11 Jul 2022 08:59:09 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:52916) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oAt05-00054q-G6 for 56439@debbugs.gnu.org; Mon, 11 Jul 2022 08:59:03 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (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-201.mailbox.org (Postfix) with ESMTPS id 4LhP8S4CbRz9sVt for <56439@debbugs.gnu.org>; Mon, 11 Jul 2022 14:58:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reilysiegel.com; s=MBO0001; t=1657544328; 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=Yyl6SNcAt5s97WRnI1IckLvoUO6Gc7Ilxp6xV0hLC8A=; b=y3nrOpvQ+ch76ddtFdqTVgvbpqpZVW0hLMRsCNcEYF1Kd+2BNZAwcGq0qMJY+tFbWnSIWe 9vb9UXE7ZfqhIYT+0ZAc/DacRyE99t3JNEv7KV1z3MPWpMFt1/YUXZx3ZCn5KnzLepfIii GTZa57TiUVqCO1Y6dWsxkoGQLzJE7gLoDJL4JAC7mTMR+hLej3uzg15HFkvkkdGfjFX94J Ol8a8RGH6yYsO5n1D819OeD1DOP8fVugUP+RpwYK76C0OohHWdExLVaodF+3YCVQa4Umxx ne/26JvG7YfUhNbJUjqTzQNGUSKIRgaI0KCLike4cprkbvEkQaXxDmA8AbGF0g== From: Reily Siegel Date: Wed, 29 Jun 2022 17:05:26 -0400 Message-ID: <87y1wzn6v3.fsf@reilysiegel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4LhP8S4CbRz9sVt 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..f3e6cca266 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 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 +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-packages-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..819b20b6c9 --- /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 the per-user Guix channels specification."))) diff --git a/gnu/local.mk b/gnu/local.mk index 2516562ea4..b5863b1ec8 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 \