From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aIgvEoohzGJXfwAAbAwnHQ (envelope-from ) for ; Mon, 11 Jul 2022 15:11:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SCDgEYohzGJ47AAAauVa8A (envelope-from ) for ; Mon, 11 Jul 2022 15:11:38 +0200 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 310813D221 for ; Mon, 11 Jul 2022 15:11:37 +0200 (CEST) Received: from localhost ([::1]:48108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAtCK-0004v6-9T for larch@yhetil.org; Mon, 11 Jul 2022 09:11:36 -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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1657545097; h=from:from:sender:sender: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=Yyl6SNcAt5s97WRnI1IckLvoUO6Gc7Ilxp6xV0hLC8A=; b=fvfwSHXY+s19MMLcNfNR0ZjSg37sVI1DMc5ZVWTCQaKuKGjMeNvhKee0jBYOglAL5dW259 kCi2auPjRxj8mI+PoWEEZZfNa1zxi/TlQA+X0BsRck3rh6CFfi6+vva6pMHB6qAuOUPRAi LG3cdCUnqre9ZKAu0kwsWYxcCEFYweLfBTaICmVTjuKLDuI6d9A1eAt0wWkDNY89qIC+eI +jMS+kTLMflk4IMvLAMZAJbU5JG1Djo5Pi41HArbhGqI5n+trnEc+ykYBwuiXOFWxadAed DbF50Bk73ZEZ7KkAjFO76cZS8NoJBYSm4I0annPv4TxbSGG+qySBj1Htu+ynOg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657545097; a=rsa-sha256; cv=none; b=Fihn45BY6wGHmtYl3Ew6NEr4jMOpN/Utx0kQsFY/dLwHciPF0YCNeUT5tOyGgZySMc4iqL hfT8eN8gXwHrCW7Ab4mSkTTgEN8vpNrc0hXvKI51HdYRWVbwWs2vKl8YWrDyDVGJJy0lF5 58nZP3NxwSi25HyKU2tUV9LRYx4pP2NOMTqtNrBgcBuR22Dns8QoxVKF7VT1JdABOD5mfq 4DzGRqhGBcb3nD1wH14SjBQPgU/eWgTPMuk+HiQIw0phLKNqK6rnNIrA8yRX6/vUKmN/W7 w6dOKKqK17lErAgSIEGwUAsuZi6BdKIjLO88BaXZTqQsNoi55lZXMuqvy9Ir/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=y3nrOpvQ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 1.85 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=y3nrOpvQ; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 310813D221 X-Spam-Score: 1.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: 7yE4Yb9zrRCr * 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@* =20 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 clien= t. * Desktop: Desktop Home Services. Services for graphical environmen= ts. +* Guix: Guix Home Services. Services for Guix. @end menu @c In addition to that Home Services can provide =20 @@ -40073,6 +40075,36 @@ format. =20 @end deftp =20 +@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 =20 @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 =C2=A9 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 =3D \ %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 \ --=20 Reily Siegel