scripts: home: Make ‘guix home import’ write home-configuration.scm.

* guix/scripts/home.scm (process-command): Populate ‘home-configuration.scm’
  in the destination directory instead of printing to stdout.
* doc/guix.texi (Declaring the Home Environment): Adjust accordingly.
(Invoking guix home): Likewise.

Suggested-by: Ludovic Courtès <ludo@gnu.org>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Xinglu Chen 2021-11-07 12:13:32 +01:00 committed by Ludovic Courtès
parent 609066e996
commit f5fc395ab4
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 16 additions and 28 deletions

View file

@ -274,7 +274,15 @@ argument list and OPTS is the option alist."
(_ (leave (G_ "wrong number of arguments~%"))))))
(unless (file-exists? destination)
(mkdir-p destination))
(import-manifest manifest destination (current-output-port))))
(call-with-output-file
(string-append destination "/home-configuration.scm")
(cut import-manifest manifest destination <>))
(info (G_ "'~a' populated with all the Home configuration files~%")
destination)
(display-hint (format #f (G_ "\
Run @command{guix home reconfigure ~a/home-configuration.scm} to effectively
deploy the home environment described by these files.\n")
destination))))
((describe)
(match (generation-number %guix-home)
(0