Subject: Re: bug#74980: [PATCH] home: container: Create symlink to .guix-home/profile.

From: "Danny Milosavljevic" <[email-masked]>
Date: Sun, 22 Dec 2024 00:16:51 +0100 (CET)

Hi,

Gabriel Wicki wrote on 19.12.2024 22:00 (GMT +01:00):
> * guix/scripts/home.scm: Create the symlink.
> 
> Change-Id: Ib299c53f7cd0ca6ad204325b5c150d579224afd7
> ---
>  guix/scripts/home.scm | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm
> index b4c82d275f..50aaf2abf6 100644
> --- a/guix/scripts/home.scm
> +++ b/guix/scripts/home.scm
> @@ -344,6 +344,10 @@ (define* (spawn-home-container home
>             (primitive-load (string-append #$home "/activate"))
>             (setenv "GUIX_NEW_HOME" #f)
>  
> + (system* "ln" "-s"
> + (string-append #$home-directory "/.guix-home/profile")
> + (string-append #$home-directory "/.guix-profile"))

Isn't that dangerous?

What happens if you invoke "guix install xyz" after that?

That would have guix mutate the contents of ~/.guix-profile , even though the .guix-home/profile is derived from a declarative manifest, right?

Or does it at  least only swap out the link for a new .guix-profile directory ?

I'm too much of a chicken to try...

I mean I can see what you mean but I'm not sure that guix expects the user to do that.