Subject: [bug#50873] [PATCH 0/5] Fixes to ‘guix home import’

From: Ludovic Courtès <[email-masked]>
Date: Wed, 13 Oct 2021 11:24:00 +0200

Hello,

Xinglu Chen <[email-masked]> skribis:

> Copy the appropriate the relevant configuration files to the destination
> directory, and call ‘local-file’ on them.
>
> Without this, ‘guix home import’ will generate a service declaration like this
>
>   (service
>    home-bash-service-type
>    (home-bash-configuration
>     (bashrc
>      (list (slurp-file-gexp
>             (local-file "/home/yoctocell/.bashrc"))))))
>
> but when running ‘guix home reconfigure’, the ~/.bashrc file would be moved, so
> when running ‘guix home reconfigure’ for the second time, it would read the
> ~/.bashrc which is itself a symlink to a file the store.

Ooh, good catch!

> * guix/scripts/home/import.scm (%destination-directory): New parameter.
> (generate-bash-module+configuration): Adjust accordingly.
> (modules+configurations): Copy the user’s configuration file to
> ‘%destination-directory’.
> * guix/scripts/home.scm (process-command): Adjust accordingly; create
> ‘%destination-directory’ if it doesn’t exist.

[...]

> +(define %destination-directory
> +  (make-parameter (string-append (getenv "HOME") "/src/guix-config")))

Instead of making it a parameter, with a default value that looks fishy
but is never actually used :-), can we make it an explicit parameter of
‘generate-bash-module+configuration’?

Otherwise LGTM!

Thanks,
Ludo’.