unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* RFC: Configurable placing of the ~/.guix-home symlink
@ 2022-04-29 14:44 EuAndreh
  2022-05-05  6:44 ` Andrew Tropin
  2022-05-05  6:55 ` Attila Lendvai
  0 siblings, 2 replies; 9+ messages in thread
From: EuAndreh @ 2022-04-29 14:44 UTC (permalink / raw)
  To: guix-devel

Hi Guix!

When trying to get a clean $HOME, I see that the ~/.guix-home path is fixed in
the code under gnu/home/*,
usually via (string-append (GETENV "HOME") "/.guix-home").

I want to propose a configurable path to ~/.guix-home, and allow this to be
chosen in the (home-environment ...) declaration.  It would expose a
GUIX_HOME_PATH_ENVIRONMENT variable[0] so that one could dynamically retrieve
the path to it, if needed in scripts or similar.  The implementation would also
need to be able to handle changes in the (home-environment ...) declaration,
and know when to remove the old symlink from ~/.guix-home to the new path,
similar to what the gnu/home/services/symlink-manager.scm does nowadays.

How do you feel about this?  What do you think?  Is there a shortcoming,
pitfalls, limitations that this approach entails?

I'm willing do work on the implementation and on tests where applicable, and
send the patches (eventually when I get this done =p).  I wanted to raise a
discussion before jumping into the code, even to get input and see how the
community feels about this.

WDYT?


[0]: I'm not picking this name, I just made up to make this more concrete.  I'd
     look at the existing variable declarations, such as those exposed by
     `guix shell` to make it consistent with them.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-04-29 14:44 RFC: Configurable placing of the ~/.guix-home symlink EuAndreh
@ 2022-05-05  6:44 ` Andrew Tropin
  2022-05-15  0:07   ` EuAndreh
  2022-05-05  6:55 ` Attila Lendvai
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Tropin @ 2022-05-05  6:44 UTC (permalink / raw)
  To: EuAndreh, guix-devel

[-- Attachment #1: Type: text/plain, Size: 2437 bytes --]

On 2022-04-29 11:44, EuAndreh wrote:

> Hi Guix!
>
> When trying to get a clean $HOME, I see that the ~/.guix-home path is fixed in
> the code under gnu/home/*,
> usually via (string-append (getenv "HOME") "/.guix-home").
>
> I want to propose a configurable path to ~/.guix-home, and allow this to be
> chosen in the (home-environment ...) declaration.  It would expose a
> GUIX_HOME_PATH_ENVIRONMENT variable[0] so that one could dynamically retrieve
> the path to it, if needed in scripts or similar.  The implementation would also
> need to be able to handle changes in the (home-environment ...) declaration,
> and know when to remove the old symlink from ~/.guix-home to the new path,
> similar to what the gnu/home/services/symlink-manager.scm does nowadays.
>
> How do you feel about this?  What do you think?  Is there a shortcoming,
> pitfalls, limitations that this approach entails?
>
> I'm willing do work on the implementation and on tests where applicable, and
> send the patches (eventually when I get this done =p).  I wanted to raise a
> discussion before jumping into the code, even to get input and see how the
> community feels about this.
>
> WDYT?

Hi EuAndreh,

This feature was removed from Guix Home 10 months ago:
https://git.sr.ht/~abcdw/rde/commit/a4b3a93b88f29eb4b37695e04e0ca200184fec28

I don't remember all the reasons, but it was slightly problematic.  I'll
name a few things, which come to my mind:

- Due to implementation of guix services extension mechanism, it's
  necessary to pass the path to guix home directory to some services
  explicitly and instantiate them even if they not used.

https://git.sr.ht/~abcdw/rde/commit/a4b3a93b88f29eb4b37695e04e0ca200184fec28#gnu/home.scm-1-4

- It's hard to cleanup environment variables like PATH and similiar when
  GUIX_HOME_DIRECTORY changed.
  
- It was hard to know if and where the previous generation was
  installed, right now it can be easier, but some edge cases can pop up.
  For example if activation script called outside of `guix home
  reconfigure` or some other circumstances.

If I remember something else, I'll let you know.

I don't dissuade you, but not sure if abilitiy to move ~/.guix-home
around worth the hassle.  Aesthetically pleasant paths in the cost of
development and maintaining a feature, which affects and complicates
many places.

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-04-29 14:44 RFC: Configurable placing of the ~/.guix-home symlink EuAndreh
  2022-05-05  6:44 ` Andrew Tropin
@ 2022-05-05  6:55 ` Attila Lendvai
  2022-05-06  7:26   ` Andrew Tropin
  1 sibling, 1 reply; 9+ messages in thread
From: Attila Lendvai @ 2022-05-05  6:55 UTC (permalink / raw)
  To: EuAndreh; +Cc: guix-devel

> When trying to get a clean $HOME, I see that the ~/.guix-home path is fixed in
> the code under gnu/home/*,
> usually via (string-append (GETENV "HOME") "/.guix-home").

FWIW, i was also surprised that the default is not something under ~/.config/guix/

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“The world is changed by your example, not by your opinion.”
	— Paulo Coelho (1947–)



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-05-05  6:55 ` Attila Lendvai
@ 2022-05-06  7:26   ` Andrew Tropin
  2022-05-15  0:10     ` EuAndreh
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Tropin @ 2022-05-06  7:26 UTC (permalink / raw)
  To: Attila Lendvai, EuAndreh; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

On 2022-05-05 06:55, Attila Lendvai wrote:

>> When trying to get a clean $HOME, I see that the ~/.guix-home path is fixed in
>> the code under gnu/home/*,
>> usually via (string-append (GETENV "HOME") "/.guix-home").
>
> FWIW, i was also surprised that the default is not something under ~/.config/guix/

It also can be problematic, we can't hardcode ~/.config/guix home due to
XDG spec, and at the same time XDG_CONFIG_HOME can be managed by Guix
Home, but also can be set outside, and all the points mentioned above
applicable here as well.

Back in the day, the implementation of Guix Home required a symlink in
home directory, right now due to improvements in symlink-manager and
reconfigure code it's probably not necessary and with a few patches
/var/guix/profiles/per-user/bob/guix-home/ can be used instead.

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-05-05  6:44 ` Andrew Tropin
@ 2022-05-15  0:07   ` EuAndreh
  0 siblings, 0 replies; 9+ messages in thread
From: EuAndreh @ 2022-05-15  0:07 UTC (permalink / raw)
  To: Andrew Tropin, guix-devel

Thanks for the information and for the links.  I didn't know the previous
history of this feature.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-05-06  7:26   ` Andrew Tropin
@ 2022-05-15  0:10     ` EuAndreh
  2022-05-15 13:15       ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: EuAndreh @ 2022-05-15  0:10 UTC (permalink / raw)
  To: Andrew Tropin, Attila Lendvai; +Cc: guix-devel

> [...] and with a few patches
> /var/guix/profiles/per-user/bob/guix-home/ can be used instead.

My thinking was focused exclusively on paths under $HOME, using $XDG_CONFIG_HOME
as a fallback or something similar.  Considering /var/guix/ is a reasonable
alternative.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-05-15  0:10     ` EuAndreh
@ 2022-05-15 13:15       ` Ludovic Courtès
  2022-05-15 15:41         ` EuAndreh
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Courtès @ 2022-05-15 13:15 UTC (permalink / raw)
  To: EuAndreh; +Cc: Andrew Tropin, Attila Lendvai, guix-devel

Hi,

I wonder if a ‘-p’ switch similar to that of ‘guix package’ would make
sense for ‘guix home’?

It would be up to users to make sure then that whatever “home
environment profile” they use has its startup files actually loaded.

Ludo’.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-05-15 13:15       ` Ludovic Courtès
@ 2022-05-15 15:41         ` EuAndreh
  2022-05-23 15:19           ` Ludovic Courtès
  0 siblings, 1 reply; 9+ messages in thread
From: EuAndreh @ 2022-05-15 15:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Andrew Tropin, Attila Lendvai, guix-devel

> It would be up to users to make sure then that whatever “home
> environment profile” they use has its startup files actually loaded.

What do you mean by that?  The user in this case must ensure that
$HOME_ENVIRONMENT/{setup-environment,on-first-login} are loaded?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: RFC: Configurable placing of the ~/.guix-home symlink
  2022-05-15 15:41         ` EuAndreh
@ 2022-05-23 15:19           ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2022-05-23 15:19 UTC (permalink / raw)
  To: EuAndreh; +Cc: Andrew Tropin, Attila Lendvai, guix-devel

Hi,

EuAndreh <eu@euandre.org> skribis:

>> It would be up to users to make sure then that whatever “home
>> environment profile” they use has its startup files actually loaded.
>
> What do you mean by that?  The user in this case must ensure that
> $HOME_ENVIRONMENT/{setup-environment,on-first-login} are loaded?

Yes, that’s what I meant.  Similar to what one has to do when using
multiple package profiles.

Ludo’.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-23 15:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-29 14:44 RFC: Configurable placing of the ~/.guix-home symlink EuAndreh
2022-05-05  6:44 ` Andrew Tropin
2022-05-15  0:07   ` EuAndreh
2022-05-05  6:55 ` Attila Lendvai
2022-05-06  7:26   ` Andrew Tropin
2022-05-15  0:10     ` EuAndreh
2022-05-15 13:15       ` Ludovic Courtès
2022-05-15 15:41         ` EuAndreh
2022-05-23 15:19           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).