From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 wC9BLrgfzGI7jwAAbAwnHQ (envelope-from ) for ; Mon, 11 Jul 2022 15:03:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id oFUELrgfzGKjHQAA9RJhRA (envelope-from ) for ; Mon, 11 Jul 2022 15:03:52 +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 BB5653CCBD for ; Mon, 11 Jul 2022 15:03:47 +0200 (CEST) Received: from localhost ([::1]:35664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oAt4j-00043x-Sx for larch@yhetil.org; Mon, 11 Jul 2022 09:03:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oAt43-00040U-1n for guix-patches@gnu.org; Mon, 11 Jul 2022 09:03:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44893) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oAt42-0000xC-Oa for guix-patches@gnu.org; Mon, 11 Jul 2022 09:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oAt42-0007Oo-G6 for guix-patches@gnu.org; Mon, 11 Jul 2022 09:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56439] [PATCH v3] 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:03: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.165754453327278 (code B ref 56439); Mon, 11 Jul 2022 13:03:02 +0000 Received: (at 56439) by debbugs.gnu.org; 11 Jul 2022 13:02:13 +0000 Received: from localhost ([127.0.0.1]:38790 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oAt3E-00075N-Ad for submit@debbugs.gnu.org; Mon, 11 Jul 2022 09:02:12 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:52918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oAt3B-0006zS-Tm for 56439@debbugs.gnu.org; Mon, 11 Jul 2022 09:02:10 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (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 4LhPDB3Vcnz9sV8 for <56439@debbugs.gnu.org>; Mon, 11 Jul 2022 15:02:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=reilysiegel.com; s=MBO0001; t=1657544522; 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=NK7ZlnWy7zFXvOSJfEo1OYzrl13KkUymJxy6odPyARE=; b=Nms/Q5T/N3eOIsHYRO3Qqcu3hBW5ZY11aLKaFl4V2JLVtfTzLv2CoyfcVU4uB6lAtUgd/r zk7OvMXIkarm/iz5irm0I3JoPiU+ds4Hx6pGvgLKSKtd+VGohc+dZoKL+0/9DtKHunX8M2 +hRwK+ulGicSozUB9vHWUgJAN+FTrBFQnRMw7KYdfasf+2Yw44QqnaHW4x3q89D+nc36e9 03SeHKdK+rtVf0RT6S+o2lYQjF3TTnsnVq6yqhnmOC0UcIYVb+nab0gTJEXOR6LxWQjiu+ VLeMnbq8RNl55Ec7yFdbztG0DCzv9Ss+MZ/fTF6um8lQZ4CWqwWx4ZpmNJ2T4g== From: Reily Siegel Date: Wed, 29 Jun 2022 17:05:26 -0400 Message-ID: <87v8s3n6pj.fsf@reilysiegel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4LhPDB3Vcnz9sV8 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=1657544628; 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=NK7ZlnWy7zFXvOSJfEo1OYzrl13KkUymJxy6odPyARE=; b=gI0rn3AVtxOVve8nWv3PCzRDrcxr/95BT0Ftt9jrbYqM5uWNePIk411N0LOSPqf0OrtT9+ cnzWymZ9k7iwIlHfl/DU2hMPUIcUABu4O+fXQS9HyiprPZoX5OGWjQdXnlzl1TlRnlea4A fSKuphiTZdgk9BnQT2+KnGb3dZvZmj8MUgo3hvWiPzAw+bLQ2WrDSIgZBlVij4NaNLyGif aYlb0LIa84pieo2KlqGcZde8Hd85e+Vph1L6/FmXrQCZbcEjLSAHj/VhKphp5Ahope9X2c DAhSFs1dEPf71xmOrV46npP+enBT7tdaohdqn+xL3ZRz+jXsPy4wJBpdmHS7gw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1657544628; a=rsa-sha256; cv=none; b=OBP4FM7Q7hWSjUUsNxSL/ol2hyJBCkSfCTRoCEkTd9vHCrmhLBpZbKrIsPjjDf/5DVFq/K l8qrehfLKyH/VS9ohVQ2h+ZF8iu3wYoaMRHdvLugYII6vY37iaFB0npNJHGT/tln0aPbzY oiU/HmtHwTZ5E+wP48X6PLMT/BsS93MN4fn0steCwo54fmWxutuG92fbTxFydhYvvIuj6O kBl1Xyxo7odXuKiKwjK08whcWEIF2WsvJ1nTIrPN9kIwsnn6c4Dv01m9pveSG2ANMcDh89 nNRUsUsjFxRa3eFxvGLDO8Glq16WVgODmK0q2uoOkDW9qzVsx26YNwEe6oMgrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=reilysiegel.com header.s=MBO0001 header.b="Nms/Q5T/"; 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="Nms/Q5T/"; 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: BB5653CCBD X-Spam-Score: 1.85 X-Migadu-Scanner: scn1.migadu.com X-TUID: dGLGT+46Gl1M * 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..1f49d9bd6a 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 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 +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