unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrew Tropin <andrew@trop.in>
To: 53603@debbugs.gnu.org
Cc: nick@const.fun
Subject: [bug#53603] [PATCH] doc: Add files and symlink-manager home services.
Date: Fri, 28 Jan 2022 14:52:12 +0300	[thread overview]
Message-ID: <87zgngm5wm.fsf@trop.in> (raw)

[-- Attachment #1: Type: text/plain, Size: 3576 bytes --]


* 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 most cases it's better to extend
 the required command using the appropriate service type.
 @end defvr
 
+@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
 
+@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
 
-- 
2.34.0


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

             reply	other threads:[~2022-01-28 13:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 11:52 Andrew Tropin [this message]
2022-06-22 10:43 ` [bug#53603] [PATCH] doc: Add files and symlink-manager home services Ludovic Courtès
2022-06-24 10:26   ` [bug#53603] [PATCH v2] doc: Add files, xdg-configuration " Andrew Tropin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgngm5wm.fsf@trop.in \
    --to=andrew@trop.in \
    --cc=53603@debbugs.gnu.org \
    --cc=nick@const.fun \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).