guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/09: home: Explicitly connect home-file and symlink-manager services.


From: guix-commits
Subject: 03/09: home: Explicitly connect home-file and symlink-manager services.
Date: Sun, 20 Mar 2022 14:06:51 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit d3ef61ab175ddcb1e1df792aa613beb4519a479a
Author: Andrew Tropin <andrew@trop.in>
AuthorDate: Fri Feb 11 10:55:01 2022 +0300

    home: Explicitly connect home-file and symlink-manager services.
    
    * gnu/home/services.scm (home-files-directory): New variable.
    * gnu/home/symlink-manager.scm (update-symlinks-script): Use
    home-files-directory variable from (gnu home services).
    
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/home/services.scm                 | 22 +++++++++++++---------
 gnu/home/services/symlink-manager.scm | 15 +++++++--------
 2 files changed, 20 insertions(+), 17 deletions(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index b7ea6f08dd..e69aa1cb0f 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -43,6 +43,8 @@
             home-run-on-change-service-type
             home-provenance-service-type
 
+            home-files-directory
+
             fold-home-service-types
             home-provenance
 
@@ -74,12 +76,11 @@
 ;;; file (details described in the manual).
 ;;;
 ;;; home-files-service-type is similar to etc-service-type, but doesn't extend
-;;; home-activation, because deploy mechanism for config files is pluggable and
-;;; can be different for different home environments: The default one is called
-;;; symlink-manager (will be introudced in a separate patch series), which 
creates
-;;; links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but 
is
-;;; possible to implement alternative approaches like read-only home from 
Julien's
-;;; guix-home-manager.
+;;; home-activation, because deploy mechanism for config files is pluggable
+;;; and can be different for different home environments: The default one is
+;;; called symlink-manager, which creates links for various dotfiles and xdg
+;;; configuration files to store, but is possible to implement alternative
+;;; approaches like read-only home from Julien's guix-home-manager.
 ;;;
 ;;; home-run-on-first-login-service-type provides an @file{on-first-login} 
guile
 ;;; script, which runs provided gexps once, when user makes first login.  It 
can
@@ -262,11 +263,14 @@ esac
 
   (file-union "files" files))
 
+;; Used by symlink-manager
+(define home-files-directory "files")
+
 (define (files-entry files)
   "Return an entry for the @file{~/.guix-home/files}
 directory containing FILES."
   (with-monad %store-monad
-    (return `(("files" ,(files->files-directory files))))))
+    (return `((,home-files-directory ,(files->files-directory files))))))
 
 (define home-files-service-type
   (service-type (name 'home-files)
@@ -276,8 +280,8 @@ directory containing FILES."
                 (compose concatenate)
                 (extend append)
                 (default-value '())
-                (description "Configuration files for programs that
-will be put in @file{~/.guix-home/files}.")))
+                (description "Files that will be put in
+@file{~~/.guix-home/files}, and further processed during activation.")))
 
 (define %initialize-gettext
   #~(begin
diff --git a/gnu/home/services/symlink-manager.scm 
b/gnu/home/services/symlink-manager.scm
index eb13d60496..16031ea5d3 100644
--- a/gnu/home/services/symlink-manager.scm
+++ b/gnu/home/services/symlink-manager.scm
@@ -26,12 +26,11 @@
 
 ;;; Comment:
 ;;;
-;;; symlink-manager cares about configuration files: it backs up files
-;;; created by user, removes symlinks and directories created by a
-;;; previous generation, and creates new directories and symlinks to
-;;; configuration files according to the content of files/ directory
-;;; (created by home-files-service) of the current home environment
-;;; generation.
+;;; symlink-manager cares about xdg configurations and other files: it backs
+;;; up files created by user, removes symlinks and directories created by a
+;;; previous generation, and creates new directories and symlinks to files
+;;; according to the content of directories (created by home-files-service) of
+;;; the current home environment generation.
 ;;;
 ;;; Code:
 
@@ -84,7 +83,7 @@
            ;; store item containing a home generation.
            (define config-file-directory
              ;; Note: Trailing slash is needed because "files" is a symlink.
-             (string-append home-generation "/files/"))
+             (string-append home-generation "/" #$home-files-directory "/"))
 
            (define (strip file)
              (string-drop file
@@ -143,7 +142,7 @@
            ;; Create in $HOME symlinks for the files in HOME-GENERATION.
            (define config-file-directory
              ;; Note: Trailing slash is needed because "files" is a symlink.
-             (string-append home-generation "/files/"))
+             (string-append home-generation "/" #$home-files-directory "/"))
 
            (define (strip file)
              (string-drop file



reply via email to

[Prev in Thread] Current Thread [Next in Thread]