mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-28 14:01:29 -05:00
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>
This commit is contained in:
parent
d05954047f
commit
d3ef61ab17
2 changed files with 20 additions and 17 deletions
|
@ -43,6 +43,8 @@ (define-module (gnu home services)
|
||||||
home-run-on-change-service-type
|
home-run-on-change-service-type
|
||||||
home-provenance-service-type
|
home-provenance-service-type
|
||||||
|
|
||||||
|
home-files-directory
|
||||||
|
|
||||||
fold-home-service-types
|
fold-home-service-types
|
||||||
home-provenance
|
home-provenance
|
||||||
|
|
||||||
|
@ -74,12 +76,11 @@ (define-module (gnu home services)
|
||||||
;;; file (details described in the manual).
|
;;; file (details described in the manual).
|
||||||
;;;
|
;;;
|
||||||
;;; home-files-service-type is similar to etc-service-type, but doesn't extend
|
;;; 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
|
;;; home-activation, because deploy mechanism for config files is pluggable
|
||||||
;;; can be different for different home environments: The default one is called
|
;;; and can be different for different home environments: The default one is
|
||||||
;;; symlink-manager (will be introudced in a separate patch series), which creates
|
;;; called symlink-manager, which creates links for various dotfiles and xdg
|
||||||
;;; links for various dotfiles (like $XDG_CONFIG_HOME/$APP/...) to store, but is
|
;;; configuration files to store, but is possible to implement alternative
|
||||||
;;; possible to implement alternative approaches like read-only home from Julien's
|
;;; approaches like read-only home from Julien's guix-home-manager.
|
||||||
;;; guix-home-manager.
|
|
||||||
;;;
|
;;;
|
||||||
;;; home-run-on-first-login-service-type provides an @file{on-first-login} guile
|
;;; 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
|
;;; script, which runs provided gexps once, when user makes first login. It can
|
||||||
|
@ -262,11 +263,14 @@ (define (assert-no-duplicates files)
|
||||||
|
|
||||||
(file-union "files" files))
|
(file-union "files" files))
|
||||||
|
|
||||||
|
;; Used by symlink-manager
|
||||||
|
(define home-files-directory "files")
|
||||||
|
|
||||||
(define (files-entry files)
|
(define (files-entry files)
|
||||||
"Return an entry for the @file{~/.guix-home/files}
|
"Return an entry for the @file{~/.guix-home/files}
|
||||||
directory containing FILES."
|
directory containing FILES."
|
||||||
(with-monad %store-monad
|
(with-monad %store-monad
|
||||||
(return `(("files" ,(files->files-directory files))))))
|
(return `((,home-files-directory ,(files->files-directory files))))))
|
||||||
|
|
||||||
(define home-files-service-type
|
(define home-files-service-type
|
||||||
(service-type (name 'home-files)
|
(service-type (name 'home-files)
|
||||||
|
@ -276,8 +280,8 @@ (define home-files-service-type
|
||||||
(compose concatenate)
|
(compose concatenate)
|
||||||
(extend append)
|
(extend append)
|
||||||
(default-value '())
|
(default-value '())
|
||||||
(description "Configuration files for programs that
|
(description "Files that will be put in
|
||||||
will be put in @file{~/.guix-home/files}.")))
|
@file{~~/.guix-home/files}, and further processed during activation.")))
|
||||||
|
|
||||||
(define %initialize-gettext
|
(define %initialize-gettext
|
||||||
#~(begin
|
#~(begin
|
||||||
|
|
|
@ -26,12 +26,11 @@ (define-module (gnu home services symlink-manager)
|
||||||
|
|
||||||
;;; Comment:
|
;;; Comment:
|
||||||
;;;
|
;;;
|
||||||
;;; symlink-manager cares about configuration files: it backs up files
|
;;; symlink-manager cares about xdg configurations and other files: it backs
|
||||||
;;; created by user, removes symlinks and directories created by a
|
;;; up files created by user, removes symlinks and directories created by a
|
||||||
;;; previous generation, and creates new directories and symlinks to
|
;;; previous generation, and creates new directories and symlinks to files
|
||||||
;;; configuration files according to the content of files/ directory
|
;;; according to the content of directories (created by home-files-service) of
|
||||||
;;; (created by home-files-service) of the current home environment
|
;;; the current home environment generation.
|
||||||
;;; generation.
|
|
||||||
;;;
|
;;;
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
|
@ -84,7 +83,7 @@ (define (cleanup-symlinks home-generation)
|
||||||
;; store item containing a home generation.
|
;; store item containing a home generation.
|
||||||
(define config-file-directory
|
(define config-file-directory
|
||||||
;; Note: Trailing slash is needed because "files" is a symlink.
|
;; 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)
|
(define (strip file)
|
||||||
(string-drop file
|
(string-drop file
|
||||||
|
@ -143,7 +142,7 @@ (define (create-symlinks home-generation)
|
||||||
;; Create in $HOME symlinks for the files in HOME-GENERATION.
|
;; Create in $HOME symlinks for the files in HOME-GENERATION.
|
||||||
(define config-file-directory
|
(define config-file-directory
|
||||||
;; Note: Trailing slash is needed because "files" is a symlink.
|
;; 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)
|
(define (strip file)
|
||||||
(string-drop file
|
(string-drop file
|
||||||
|
|
Loading…
Reference in a new issue