From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id oDD1NCT9xmLWQwEAbAwnHQ (envelope-from ) for ; Thu, 07 Jul 2022 17:35:00 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id AODqNCT9xmL9NAEAauVa8A (envelope-from ) for ; Thu, 07 Jul 2022 17:35:00 +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 56FB841E3A for ; Thu, 7 Jul 2022 17:35:00 +0200 (CEST) Received: from localhost ([::1]:49738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9TWs-0001cd-SA for larch@yhetil.org; Thu, 07 Jul 2022 11:34:58 -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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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+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=1657208100; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=IvGK+2bRDHBu+bFTYkTq7ougQKQ9iu0NAFY52V1FZ0Q=; b=PNOMHS04vrV1eQ/cKJNkcKQ4ZtN2JfkOW9NX1PrTY1QY5E9wY/m9VlTJSgaxWUzQpfhjYg F1y0k9U31BYuqWy5PkT/JZc1czx9mQgSqtgxoRX8QVPl3aWeuYEYdl3dFOFeuLmWN4Wa/J Ac7A3hLT22aLxkU59vt6PlMtbcoVvX0nVqMn1Tjk6Y/mrTVR5Cx7KHTPZcRFWHfgkRcjeg h7dQrKNd4qSWUYDmMQ/7Li467pO8CLs/kSMDoXV3L9+iIWyoHgnEMGbB5+ReJXN6WAq6nq LUd5ZOaaZbEzHFr1fHnRvR2r8HOf+Uz1nRVCG7cDoRdAe0x4FJN8oox+RRtxUg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657208100; a=rsa-sha256; cv=none; b=uAWXZVHbYFtEVC+x3/I70+qY3KV3rRuXy5zyzbHEdefuDR1hLH7zfYeyQslDrWd0o9pJ60 pkY/CSoaIMFSzrFqPP2PFr9eWDnJSC4Ge6R7RBGDySZORu5IFpAmh79K/LHTJOGqk3Eqs9 aMXWqzTIzI3dryodICWvZ5D/Pk5ar2j+YGXzbUT1FLPZi6rfSKEnZSz5cgYlC3syZv4l/2 KsdOE1rWv4UQTy6fRU86HiLtsPLWTLoUQWtS46Bs558tOmXKvjE4zPmTHyu13iCVMH1kbW TjIgCaB0o1IUVh6uFdcSGYs2Y/GHOHR3cjsqdgNx7xjGKKm/eE9av/if+kjHPA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=gl30O15U; 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: 2.15 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b=gl30O15U; 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: 56FB841E3A X-Spam-Score: 2.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: jwyY3zEMSu4u * 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@* =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 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 =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..428daff1c4 --- /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 $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 =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