From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +FbqOVrs82FZyQAAgWs5BA (envelope-from ) for ; Fri, 28 Jan 2022 14:15:06 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8JtLN1rs82FOSAAA9RJhRA (envelope-from ) for ; Fri, 28 Jan 2022 14:15:06 +0100 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 770DA3D60A for ; Fri, 28 Jan 2022 14:15:06 +0100 (CET) Received: from localhost ([::1]:48294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDR5l-0004Bt-4T for larch@yhetil.org; Fri, 28 Jan 2022 08:15:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDPrG-0005GW-TL for guix-patches@gnu.org; Fri, 28 Jan 2022 06:56:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDPrG-00049W-IU for guix-patches@gnu.org; Fri, 28 Jan 2022 06:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nDPrG-0006LA-HM for guix-patches@gnu.org; Fri, 28 Jan 2022 06:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53603] [PATCH] doc: Add files and symlink-manager home services. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 28 Jan 2022 11:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 53603 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53603@debbugs.gnu.org Cc: nick@const.fun X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164337091824303 (code B ref -1); Fri, 28 Jan 2022 11:56:02 +0000 Received: (at submit) by debbugs.gnu.org; 28 Jan 2022 11:55:18 +0000 Received: from localhost ([127.0.0.1]:57651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDPqX-0006Ju-NI for submit@debbugs.gnu.org; Fri, 28 Jan 2022 06:55:17 -0500 Received: from lists.gnu.org ([209.51.188.17]:41096) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDPqW-0006Jl-0Y for submit@debbugs.gnu.org; Fri, 28 Jan 2022 06:55:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDPqU-0002wW-4s for guix-patches@gnu.org; Fri, 28 Jan 2022 06:55:15 -0500 Received: from [2a00:1450:4864:20::22f] (port=42679 helo=mail-lj1-x22f.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDPqR-0003sc-W9 for guix-patches@gnu.org; Fri, 28 Jan 2022 06:55:13 -0500 Received: by mail-lj1-x22f.google.com with SMTP id a25so8641100lji.9 for ; Fri, 28 Jan 2022 03:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version; bh=0QJH52hDggkwWpxbQEOG6mYlDlh2LRhPqQRZYVkVc30=; b=CsVyRQl6ZpKuSNzebV+i+QQLUfMxw5NPpJbkYxaiei3vXIMNQu8KTvtAtY3oKdajlJ SSwSQ9C2uFtEHgXPNY3HIUa+0GxOTn4jNxz6H1WoNXsVzYaJM2JhndYnxHW5Etn4dI8t oWPFHnEBU8WYNXJKL78EsqVHqmJf3wTM9YorYUwz2wRjfkZFE/RuChAzrTlsNxNta2he IMrEnMvL1YjmCd+nn/4ZynhgAHWzZ2A91A8SItDD8NS9Dp/GrzNbgkXX1kdncMkhlt8T ttnFrg2jwHaAZbW4cczWGj7BSQBI5n9LeZX9NjS8wOYn0gHY2XSHGNpPQ59SlVBXJKZL qhbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version; bh=0QJH52hDggkwWpxbQEOG6mYlDlh2LRhPqQRZYVkVc30=; b=Ynzi/4U25qBZ+2L5omAQWv28PAj5Q1bTmPfd1QQkCkl70Lx4oL4KtPdsVvM8gThu+9 Q4tYHPoTkBMtEI1Dy7j1GbbOS0pa5yWjDYX1MCwvePhg31IC9z8bwoqD6+K/9AdJR5Gy qoyXMz5PDy1l+6EoR06oYV4ZplCTZ75OU1g1DTllhWf+8NIoq9ahoLQcVhr1tynQ0s68 fB4ab0wC9L5YakCx7Yqb68ahB30NyL9NpZl55CowK4gpK9/xDvT/Om6q7L+gzitual6N yhJr0KUHnrjPq9/WlXcfyUVmp0iJljozq9+pyuUiCWbN9wdNEGbisv0s9ThhFWbbP7ox tmmw== X-Gm-Message-State: AOAM533gKocVfu+xdbia3KKpYgKdfkuAk8PyXLzskF9uUlTbHdrdJy3f GBY/2D56fRUrv7B7QkNGgi50yHsJU86dxg== X-Google-Smtp-Source: ABdhPJyHtExSV4Ok3ql5kLf1kX3p22Dj6IJUnVLfmJMv2Y4WhKyl1dWSouKKOF1jy1+LXmgHrytPQQ== X-Received: by 2002:a2e:9bd4:: with SMTP id w20mr5731566ljj.324.1643370909448; Fri, 28 Jan 2022 03:55:09 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id a24sm424309lff.97.2022.01.28.03.55.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 03:55:08 -0800 (PST) From: Andrew Tropin Date: Fri, 28 Jan 2022 14:52:12 +0300 Message-ID: <87zgngm5wm.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::22f (failed) Received-SPF: none client-ip=2a00:1450:4864:20::22f; envelope-from=andrew@trop.in; helo=mail-lj1-x22f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643375706; 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:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=0QJH52hDggkwWpxbQEOG6mYlDlh2LRhPqQRZYVkVc30=; b=CXEPY+PcjCg1CpjNrX4ZE0r6LwYAEiLEb+HQdCP3pHnmdFdxQgHRkqyEHBYEp2lQk+eSOK u2xPcJLdNXY109sE5G6TL80OvUB43XoE73CMKf1NY6F7aUZgoiYsjVYiBI09e7h7hzh2fG Fj4jkA22D6lMqhd2K/yoI2BH+6QARBnj3NmJSxW99J0fKoQuzdXuWheyyEhzZkAQaMqVCY TQwj4htQ/xQJY3UaTZXltxulBPFGtZC1QYvKTqcBdzhwrRgPB5r7JQSXcxWvsjFCkS+acw dhqflT7HaNtufalNONCgo8ZzI3EB6tmu3MMmk21P22EoXHl9eFvyGfg8/NqEog== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643375706; a=rsa-sha256; cv=none; b=She4kOhl6LAkX9tz0E1wys+QW4ZfqseIP3VFSrcRlIQ3YztGal5dU6Z0ojR5LZzimsQMT/ a17lnTOckcOtT1gdxrsEIlSEubOB1QXaO6a0TY487NkEmyNMPeNLpenooo6nCXsIeq7iDI QSWYZKzbzwkQXX5RzaaGlrQLGJpe/mQtjTUxWN0eYJQqITWKSe4nOvdTI3IlE4EHev5aVj TYXq0lVGO9KtF5U9H5S/Vc2PqXi33XW2kCwy40g21E9TITIH4C+iXkh6ZircJhRnetERfI 1DFXhQsWqEJROrSF/+lcbDU95NNYgIWiN504aWb7jW0hBB8WpU1BEsFZD7s+bQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=CsVyRQl6; 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: -3.93 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=CsVyRQl6; 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: 770DA3D60A X-Spam-Score: -3.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: tmUGV8HPjLFB --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable * doc/guix.texi (Essential Home Services): Add files and symlink-manager ho= me services. =2D-- doc/guix.texi | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index c94f85589f..2edea2c943 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -37500,12 +37500,77 @@ 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 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 + +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 to files from @file{~/.guix-home/files} in home folder, 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-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 will become empty also will be +cleaned up. + +@item +Creates new symlinks the following way: It looks @file{files/} directory +(usually generated with @code{home-files-service-type}), 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 go to @file{$HOME} and the dot will be appended. +@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.34.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmHz2ZkPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wkNYP9jTc32kjMOtAq3xcP6LE8ZfmaFAb77YERSR9 62jeNGOFEaXWLXV09jzl432ZeyFdGFGLin4wLUqDpJC8GRlmGyBCsD91ov1d97Vt czQpyoyCBqEyfI4WywxvmxzD8qsZxxM7u0/L3Xz3/lXWKleAbfaGPZShRa0sR2Np pQTJuIrGXPNOQnrUGUk2U6RiHI+WOBg7bJRmVnU/mUfOC601QJbZVNPkfotaP2YD Uu/cNiPIhVsgBlNdVBtjTdyBs7+QIUDZmxwFID9wOdxHs99mYr/YsF9UU3doH8L6 o6S8TopQk9TrZdt5u+19Wq5kkaH3BSgmu6Nnk4ttiCoUun+bjJ5ZLfFemp3uFUAY SfiQH3mB/7r+Wh4uXbOyqd6Drc77oJYFe5APeplm/JAAQrL0TWoDutotiUDE+WEo tjeCw/O865PCA+jvsSFqdr94zYbRWCsIIy1K09MhmZXNSdtwtPicKxMbh/1fprve sZbXvk05S+fSP8Vi5zuE15LqWMm562ODlXn7aXE1IbuLYeEH+r1rrwgbMbfuUfuv 3iOrn8t3TzAXKKoBEvDOV/2pz0eLcLMKZJKLjqAcmyY/vAdOOf1UhONRvVpJlf/d MoS/FvdVgyaM1PuqGrrivZYVbn2MqQWlDsvA8778PNDb7gxMDxQyc4dIDpc3sX26 69Dc9Ig= =7wKP -----END PGP SIGNATURE----- --=-=-=--