unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Multiple profiles with Guix Home
@ 2021-10-03 10:50 Liliana Marie Prikler
  2021-10-04  7:17 ` zimoun
                   ` (3 more replies)
  0 siblings, 4 replies; 76+ messages in thread
From: Liliana Marie Prikler @ 2021-10-03 10:50 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

it's been a while since the discussion of whether or not to collect
multiple profiles into a single directory [1].  This suggestion takes
inspiration from that, but goes a vastly different route.  Instead of
using environment variables to control Guix, it takes advantage of the
recently added Guix Home, even if it is still a technical preview.

So, what's the proposition?  I suggest we modify home-profile-service-
type (or add a new service) such that it takes a list of <home-profile> 
records instead of a list of packages.  This record would be defined as

  (define-record-type* <home-profile> home-profile
    make-home-profile home-profile? this-home-profile
    (location home-profile-location) ; string, e.g. $HOME/.guix-profile
    (short-name home-profile-short-name) ; string or #f, if given
                                         ; construct a symlink in
                                         ; /var/guix/.../per-user/
    (manifest %home-profile-manifest) ; <manifest> or #f
    (packages home-profile-packages) ; list of <package> or #f
                                     ; fallback for manifest
    (enabled? home-profile-enabled?) ; boolean, default #t
    [...])

  (define (home-profile-manifest home-profile)
    (or (%home-profile-manifest home-profile)
        (and=> (home-profile-packages home-profile) 
               packages->manifest))))

On init/reconfigure, `guix home' creates/updates all home-profiles
which have a home-profile-manifest that is not #f and links them to the
appropriate locations.  It also creates a shell startup script that
loads those profiles that are enabled?, even if they have no manifest
(this can be used to e.g. declare a pull profile, which `guix home'
can't manage).  

Some existing home services would need to be adapted towards this
multiple profile usage.  For instance, home-fontconfig-service-type
would need to accept a list of directories, rather than hardcode its
value.

What do y'all think?

<https://lists.gnu.org/archive/html/guix-devel/2019-12/msg00358.html>



^ permalink raw reply	[flat|nested] 76+ messages in thread
* Re: Multiple profiles with Guix Home
@ 2021-10-03 20:51 John Kehayias
  0 siblings, 0 replies; 76+ messages in thread
From: John Kehayias @ 2021-10-03 20:51 UTC (permalink / raw)
  To: guix-devel@gnu.org, Liliana Marie Prikler

Hello Liliana and Guix-ers,

I like this idea as a more integrated way of using multiple profiles in Guix, which I think is a unique and powerful feature of Guix. Having more first class citizen support of profiles I think is long overdue. Thanks for the proposal!

I'm curious about what else we can then build into this service that might help some of the issues around multiple profiles that have come up before. At the very least it seems this would be a good building block for doing operations where otherwise you'd have to do a bit of looping over profiles (as suggested in the Cookbook, and I think many of us do on our own) like updating packages.

There are also some issues that have been raised before that I think this could help address, so here are a few that I've seen that could have some relevance here. Mostly around search-paths and environment variables that get tricky with multiple profiles active. Perhaps not all relevant, but I wanted to cross-reference some related (to me, at least) discussions around multiple profile support in Guix:

Recently, we discussed this in the context of some environment variables like XDG_DATA_DIRS, and the more elusive XDG_CONFIG_DIRS here https://issues.guix.gnu.org/50103  The issues is with search-paths and different profiles (e.g. needing a glib package to make sure XDG_DATA_DIRS gets updated). With a more integrated approach to multiple profiles, could this help with combined search-paths?

Older, with dbus: https://issues.guix.gnu.org/48538  Here there is a hardcoded default user profile lookup https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/services/xorg.scm#n851

Finally, I think this proposal subsumes the old discussion on https://issues.guix.gnu.org/20255  and I think would be more "canonical" with Guix Home now part of Guix.

Anyway, Guix Home does look like a good fit for better profile support and these related edge cases with profiles. I'll just summarize my current usage of profiles, which I think others do as well as it comes from the Cookbook. I have several profiles for different sets of packages, like "desktop," "emacs," and so on, with the default ~/.guix-profile being a testing ground or to quickly use something (temporarily or before moving into a profile). ~/.config/guix has a profiles directory to store each of these and a manifests directory to store the manifests for each. I use a simple bash loop to e.g. guix package for each profile to update with the manifest, or guix gc to clean up.

Hope this is helpful for this discussion,
John


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

end of thread, other threads:[~2022-05-27 13:16 UTC | newest]

Thread overview: 76+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03 10:50 Multiple profiles with Guix Home Liliana Marie Prikler
2021-10-04  7:17 ` zimoun
2021-10-04  8:11   ` Liliana Marie Prikler
2022-05-03 14:13 ` Andrew Tropin
2022-05-03 18:34   ` Liliana Marie Prikler
2022-05-03 19:13     ` Maxime Devos
2022-05-03 20:04       ` Liliana Marie Prikler
2022-05-03 20:39         ` Maxime Devos
2022-05-03 20:44         ` Maxime Devos
2022-05-04  9:25           ` Maxime Devos
2022-05-03 20:59         ` Maxime Devos
2022-05-04  4:16           ` Liliana Marie Prikler
2022-05-04  7:01             ` Maxime Devos
2022-05-04  7:08               ` Maxime Devos
2022-05-04 13:15               ` Reza Housseini
2022-05-04 13:46                 ` Maxime Devos
2022-05-04 18:14                   ` zimoun
2022-05-04 18:21                     ` Maxime Devos
2022-05-05  8:01                 ` Andrew Tropin
2022-05-04 18:38               ` Liliana Marie Prikler
2022-05-04 20:41                 ` Maxime Devos
2022-05-05  4:25                   ` Liliana Marie Prikler
2022-05-05 10:53                     ` Maxime Devos
2022-05-05 16:24                       ` Liliana Marie Prikler
2022-05-05 16:33                         ` Maxime Devos
2022-05-05 17:21                           ` Liliana Marie Prikler
2022-05-05 17:29                             ` Maxime Devos
2022-05-05 11:03                     ` Maxime Devos
2022-05-05 16:31                       ` Liliana Marie Prikler
2022-05-05 16:42                         ` Maxime Devos
2022-05-05 17:12                           ` Maxime Devos
2022-05-05 17:27                           ` Liliana Marie Prikler
2022-05-05 17:41                             ` Maxime Devos
2022-05-05 19:17                               ` Liliana Marie Prikler
2022-05-05 19:42                                 ` Maxime Devos
2022-05-05 20:20                                   ` Liliana Marie Prikler
2022-05-05 18:00                             ` Maxime Devos
2022-05-05 19:08                               ` Liliana Marie Prikler
2022-05-05 19:44                                 ` Maxime Devos
2022-05-05 23:53                                   ` zimoun
2022-05-05 20:13                                 ` Maxime Devos
2022-05-05 20:53                                   ` Liliana Marie Prikler
2022-05-05 21:28                                     ` Maxime Devos
2022-05-06  4:19                                       ` Liliana Marie Prikler
2022-05-07 23:06                                         ` Ludovic Courtès
2022-05-05 20:50                                 ` zimoun
2022-05-05 18:25                         ` zimoun
2022-05-03 21:11         ` Maxime Devos
2022-05-04  4:23           ` Liliana Marie Prikler
2022-05-04  6:57             ` Maxime Devos
2022-05-04  9:24             ` Maxime Devos
2022-05-04 13:05     ` Andrew Tropin
2022-05-05 11:05 ` Maxime Devos
2022-05-05 16:22   ` Liliana Marie Prikler
2022-05-05 17:07     ` Maxime Devos
2022-05-05 17:19       ` Liliana Marie Prikler
2022-05-05 17:29         ` Maxime Devos
2022-05-05 18:24           ` Liliana Marie Prikler
2022-05-05 20:14             ` Maxime Devos
2022-05-05 20:27               ` Liliana Marie Prikler
2022-05-05 20:38                 ` Maxime Devos
2022-05-05 20:41                 ` Maxime Devos
2022-05-05 20:26             ` Maxime Devos
2022-05-06 18:40               ` Liliana Marie Prikler
2022-05-06 19:54                 ` Maxime Devos
2022-05-06 21:32                   ` Liliana Marie Prikler
2022-05-07  7:17                     ` Maxime Devos
2022-05-23 13:14 ` Andrew Tropin
2022-05-23 17:05   ` Liliana Marie Prikler
2022-05-24 11:55     ` Andrew Tropin
2022-05-24 18:31       ` Liliana Marie Prikler
2022-05-25 11:01         ` Andrew Tropin
2022-05-25 23:36           ` Liliana Marie Prikler
2022-05-27 12:52             ` andrew
2022-05-27 13:14               ` Liliana Marie Prikler
  -- strict thread matches above, loose matches on Subject: below --
2021-10-03 20:51 John Kehayias

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).