From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 2MJtH92RtWLTGAAAbAwnHQ (envelope-from ) for ; Fri, 24 Jun 2022 12:28:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 0M9yH92RtWJvYwAAauVa8A (envelope-from ) for ; Fri, 24 Jun 2022 12:28:45 +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 7976CAE47 for ; Fri, 24 Jun 2022 12:28:44 +0200 (CEST) Received: from localhost ([::1]:58052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o4gYN-0005T1-7U for larch@yhetil.org; Fri, 24 Jun 2022 06:28:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o4gWp-0005E2-3r for guix-patches@gnu.org; Fri, 24 Jun 2022 06:27:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o4gWk-0008KY-Gl for guix-patches@gnu.org; Fri, 24 Jun 2022 06:27:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o4gWk-0002QO-CB for guix-patches@gnu.org; Fri, 24 Jun 2022 06:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#53603] [PATCH v2] doc: Add files, xdg-configuration and symlink-manager home services. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Jun 2022 10:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53603 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 53603@debbugs.gnu.org, nick@const.fun Received: via spool by 53603-submit@debbugs.gnu.org id=B53603.16560663939247 (code B ref 53603); Fri, 24 Jun 2022 10:27:02 +0000 Received: (at 53603) by debbugs.gnu.org; 24 Jun 2022 10:26:33 +0000 Received: from localhost ([127.0.0.1]:40932 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4gWG-0002P4-Va for submit@debbugs.gnu.org; Fri, 24 Jun 2022 06:26:33 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o4gWF-0002Or-MC for 53603@debbugs.gnu.org; Fri, 24 Jun 2022 06:26:32 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id D939440017; Fri, 24 Jun 2022 10:26:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1656066385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KkxiPTu3mQNR4L+AyAUWPgeFQbUWUjRDsmAiWASGG4c=; b=honnqa03YNu2lkRWRzDiNAt6Nu1uOGJsEQ9hF+zlsldPLQsZuokAFzBrrB6OTh9RqcXU1+ Kad4pUYH/ZbFRKKeTrnEv2w/nfKVNc54VqYZHWG0zxTaFThiVnDJf8upC/dx8zorpBbSVv 2e9gVATGp6vuht99moVnRLeK4llZClF1E/UclQvxUPxl9bNaAdl5OeiZC6vgMxaUJpNwhA 0DhR8iquIs7GuRoONvQEl1Z4P6SkDFC3XNbKhVCZS9/Nmr4O75I86sroEUSnNteZaQZRPw ybgv+bMKkaPEkV1pO6BhXoqpTxBPAeN4TihDRS5brN2Wtj6UKm5QaZBF/PQDQg== From: Andrew Tropin In-Reply-To: <87a6a53rn5.fsf@gnu.org> References: <87zgngm5wm.fsf@trop.in> <87a6a53rn5.fsf@gnu.org> Date: Fri, 24 Jun 2022 13:26:21 +0300 Message-ID: <87h74abbn6.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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=1656066525; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=KkxiPTu3mQNR4L+AyAUWPgeFQbUWUjRDsmAiWASGG4c=; b=tQE9pItAkp1qdX7s1ygMB2BZtHSOHXs0uJfMOPZ7HgL11tyCEV1u2Mx8eRnLiPivdjVSDk TMHcERQgmU709R3J8DRxX1dv//BKYGkLQ3LkB/DPwcy7Kgws25hJAcHxa1jEc3wsZ0tM7f qCHiorOjSGknqhysciT8cKoizPqXXxnHdVmahRDTjcNmthHmrTSzLw57lKGwJr8n84OyBo T5dULMNmNqYm8DA2UpSa6KZs3zvG1T2g+JyZ5fh4ulpk1prcqpT00JDRxI3BC7xUFGC0Hj YHSe1QbiO6hEilTSiRMSA2rK8RhZVvz89f8DuaENxHE30hUAqYrRKKvPffvnEg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1656066525; a=rsa-sha256; cv=none; b=peoQ9kz5Ofxh589/V7HefuZPfBTo39OpGUqJkdymo+x/6Ltb0rmDunK+ZeFOWPrUdEpKp5 GZrKyeU3pCvcD/n5XAYJdleEKuS+XXQ6UiWamO9/ZNkhgYAex+D4V9TX0iTO5S11ypzZyF PvmNqXfwoytDxCmQh8y2zPdDaY1HozjqXuwrk6TH12ZhBZk87AlthcghuO+1fxv4WcM0// 3mm75mo8gjQFB8Pi2cFzexCXULXOilGe6Z8RgUWfaBj/oTYkgsdFByjgTrE+VPv6TuYrd7 D5pf9ste++wXoE5LFCeFQram2T3pAT043eUr8Jct6cFaQdoLWjXUkgP9sVJmvQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=honnqa03; 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: 0.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=honnqa03; 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: 7976CAE47 X-Spam-Score: 0.03 X-Migadu-Scanner: scn0.migadu.com X-TUID: RJG0pGD2w2UN --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-06-22 12:43, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > Andrew Tropin skribis: > >> * doc/guix.texi (Essential Home Services): Add files and symlink-manager= home >> services. >> --- >> doc/guix.texi | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 65 insertions(+) >> >> diff --git a/doc/guix.texi b/doc/guix.texi >> index c94f85589f..2edea2c943 100644 >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -37500,12 +37500,77 @@ users @emph{should not} use this service, in m= ost cases it's better to extend >> the required command using the appropriate service type. >> @end defvr >>=20=20 >> +@defvr {Scheme Variable} home-files-service-type >> +The service of this type allows to specify a list of files, which will >> +go to @file{~/.guix-home/files}, usually it contains configuration files >> +(to be more precise it contains symlinks to files in @file{/gnu/store}), >> +which should be placed in @file{$XDG_CONFIG_DIR} or in rare cases in >> +@file{$HOME}. It accepts extension values in the following format: >> + >> +@lisp >> +`(("config/sway/config" ,sway-file-like-object) >> + ("config/tmux/tmux.conf" ,(local-file "./tmux.conf"))) >> +@end lisp > > I think you wrote it shortly before =E2=80=98home-files-service-type=E2= =80=99 was > changed to not prepend a dot to file names. > > Would you like to update it and resubmit? That=E2=80=99d be a welcome ad= dition. Sure. Here we go: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=v2-0001-doc-Add-files-xdg-configuration-and-symlink-manag.patch Content-Transfer-Encoding: quoted-printable From=207190711d98687973c6b75d6e3b75dbc466282801 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Fri, 28 Jan 2022 14:52:12 +0300 Subject: [PATCH v2] doc: Add files, xdg-configuration and symlink-manager h= ome services. * doc/guix.texi (Essential Home Services): Add files, xdg-configuration-fil= es and symlink-manager home services. =2D-- doc/guix.texi | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 43a5fc85bd..d099e6bf61 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -39411,12 +39411,95 @@ users @emph{should not} use this service, in most= cases it's better to extend the required command using the appropriate service type. @end defvr =20 +@defvr {Scheme Variable} home-files-service-type +The service of this type allows to specify a list of files, which will +go to @file{~/.guix-home/files}, usually this directory contains +configuration files (to be more precise it contains symlinks to files in +@file{/gnu/store}), which should be placed in @file{$XDG_CONFIG_DIR} or +in rare cases in @file{$HOME}. It accepts extension values in the +following format: + +@lisp +`((".sway/config" ,sway-file-like-object) + (".tmux.conf" ,(local-file "./tmux.conf"))) +@end lisp + +Each nested list contains two values: a subdirectory and file-like +object. After building a home environment @file{~/.guix-home/files} +will be populated with apropiate content and all nested directories will +be created accordingly, however, those files won't go any further until +some other service will do it. By default a +@code{home-symlink-manager-service-type}, which creates necessary +symlinks in home folder to files from @file{~/.guix-home/files} and +backs up already existing, but clashing configs and other things, is a +part of essential home services (enabled by default), but it's possible +to use alternative services to implement more advanced use cases like +read-only home. Feel free to experiment and share your results. +@end defvr + +@defvr {Scheme Variable} home-xdg-configuration-files-service-type +The service is very similiar to @code{home-files-service-type} (and +actually extends it), but used for defining files, which will go to +@file{~/.guix-home/files/.config}, which will be symlinked to +@file{$XDG_CONFIG_DIR} by @code{home-symlink-manager-service-type} (for +example) during activation. It accepts extension values in the +following format: + +@lisp +`(("sway/config" ,sway-file-like-object) + ;; -> ~/.guix-home/files/.config/sway/config + ;; -> $XDG_CONFIG_DIR/sway/config (by symlink-manager) + ("tmux/tmux.conf" ,(local-file "./tmux.conf"))) +@end lisp +@end defvr + @defvr {Scheme Variable} home-activation-service-type The service of this type generates a guile script, which runs on every @command{guix home reconfigure} invocation or any other action, which leads to the activation of the home environment. @end defvr =20 +@defvr {Scheme Variable} home-symlink-manager-service-type +The service of this type generates a guile script, which will be +executed during activation of home environment, and do a few following +steps: + +@enumerate +@item +Reads the content of @file{files/} directory of current and pending home +environments. + +@item +Cleans up all symlinks created by symlink-manager on previous +activation. Also, sub-directories, which become empty also will be +cleaned up. + +@item +Creates new symlinks the following way: It looks @file{files/} directory +(usually defined with @code{home-files-service-type}, +@code{home-xdg-configuration-files-service-type} and maybe some others), +takes the files from @file{files/.config/} subdirectory and put +respective links in @env{XDG_CONFIG_DIR}. For example symlink for +@file{files/.config/sway/config} will end up in +@file{$XDG_CONFIG_DIR/sway/config}. The rest files in @file{files/} +outside of @file{files/.config/} subdirectory will be treated slightly +different: symlink will just go to @file{$HOME}. +@file{files/.some-program/config} will end up in +@file{$HOME/.some-program/config}. + +@item +If some sub-directories are missing, they will be created. + +@item +If there is a clashing files on the way, they will be backed up. + +@end enumerate + +symlink-manager is a part of essential home services and is enabled and +used by default. +@end defvr + + @node Shells Home Services @subsection Shells =20 =2D-=20 2.36.1 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 Best regards, Andrew Tropin --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmK1kU0ACgkQIgjSCVjB 3rDIkxAAgaypM3Kb03BA0xxsULkSSxja14HYvm/s9NIQUydVe/o/4Z/2Jkfx+o9A QOC2AI+h/545HdLdaofQKonU7RHlcdGa4cirBxSZD1oTU5BWLy9gvRutecxLz1n5 ndFikDBh3zs4SAF1AHOKYp77YTxk5w4plivqpY90QPMEWMvplqkhg8/e8wqWtov5 C/ayvXr52oX7ozpHuW4JaHz1qcf8ji75Mbn0giVfDkbcN0xEN0F6kR9RtwPnXE6p D/LXzZDtS0yxyYjTF0p8sKXlTZ5RjbFLjJBMOueI3dWGIArXaA3GhWpm+v6g8iCq dFk3nz9qD9y0iP96YJY7lpSPjAP5t1VS0pjpWYbJWS0HJTIrWoUHpKOUspGuwRJ1 0i0+7r00h4bTnDMbCsfxdmzWR8QXyFkoStaDFC5tbYu2VDXErEnqhfYjaltNcw8W ZPLspEXh74G2ubMBC0AMnd4z3NcolmiJeCxrLRDO7pKdZPdPKl9tfbausqiv0m84 Nt0LM4Oh6+sf1C3CmED7NUe42ZA27d6wsKL9N0YV65+dvRlxlZxKBVxt6RdAAdsR 08Ta62exnaOYhRjWIqHqXeF9NqMuoHZepTy1cRiHVZNE4C2i0ot2Rt3Go/2idStH zBxpLXEmrANEeBpppgWzAXsDzCLYdBuLXwwjuY1GlRl7ca0dFbk= =1sqT -----END PGP SIGNATURE----- --==-=-=--