help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help-Guix Digest, Vol 88, Issue 4


From: 宋文武
Subject: Re: Help-Guix Digest, Vol 88, Issue 4
Date: Wed, 08 Mar 2023 09:58:36 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Gottfried <gottfried@posteo.de> writes:

> Hi,

Hello!

> 1.
>> GUIX_PROFILE="~/guix-profiles/emacs/emacs"
>>> . "$GUIX_PROFILE"/etc/profile
>
> As unexperienced in Scheme I am asking
>  if the second line beginning with the "dot" is separated for easier
>  read, but everything is one command?

Those 2 line are bash commands,
  GUIX_PROFILE="~/guix-profiles/emacs/emacs" will set a shell variable
  GUIX_PROFILE with a value of "$HOME/guix-profiles/emacs/emacs".

  . "$GUIX_PROFILE"/etc/profile will 'source' the /etc/profile in the
  $GUIX_PROFILE directory.

You can find them in 'info bash' at: "5 Shell Variables" and "4.1 Bash Shell 
Builtins".

>
> 2.
> I have got already many packages in my profile and
> updating takes a long time.
>
> So I am thinking of splitting of some packages to create several
> profiles and AFAIU updating with
> sudo guix system reconfigure /etc/config.scm
> it will take less time because it will not automatically update all my
> profiles at once. (Is this right?)

Yes, the system profile (via config.scm) and user profile already do a
split, and you can split the user profile into multiple profiles for
more control.

See 'info guix-cookbook' for "Guix Profiles in Practice".

>
> 3.
> I was creating a profile with "Musescore"
> and a profile with "Emacs".
> I want to create still other profiles.

No problem.
>
> 4.
> Now I still don’t understand everything concerning profiles.
> If I enable all profiles at login time
> how will it work?
Enable a profile mean source ('.' command in your first question) its
profile file to add its search-paths to the current shell environment:

  PATH for making binaries from profiles's bin directory available to the
  current shell.
  MANPATH for making manpages from profile's share/man dinectory
  available to the current shell's 'man' command.
  XDG_DATA_DIRS for making desktop applicatinons available to the
  current desktop environment (launcher, etc).
  And so on...

> How can I enter the different profiles?
If you enable all at login time (via ~/.bash_profile), there is no need
to switch.  If you didn't enable a profile, you can switch it with 'guix
shell -p' or '.' its profile.


> How do I know in which profile I am and to switch to an other?
You can run 'env' find out what profiles are activated now.

>
> e.g. I have emacs installed in my main profile.
> I have got a manifest with emacs with additional emacs packages.
> When entering this separate profile with guix shell
> I get to  guix shell (env)...
> but when I entered:  "emacs"
> it opened emacs with the package "Icicles" which I don’t have in my
> emacs manifest, only in my emacs in the main profile.
> So I concluded, it is the emacs in my main profile and not the one in
> my emacs manifest profile.
> How are both connected? Are they separated?
Run 'which emacs' return the emacs executable location, it maybe the one
in your main profile or the emacs profile.  There are some environment
variables / search-paths (EMACSLOADPATH) for emacs, emacs will load its
packages from this EMACSLOADPATH.  When combine profiles via source
('.') the search-paths are merged (see 'export' in the 'profile' bash
script),  so they're connected via those search-paths.

They can also be separated if you don't combine those search-paths.
eg: via 'guix shell --pure -p ...'


> But this emacs manifest doesn’t have a init.el file etc.
Emacs's init.el are at ~/.emacs.d/init.el (or ~/.emacs), it's out of
guix's control, so shared with every emacs.

> May be profiles are not completely separated in Guix like I understood
> until now.
Well, you can combine them (by default the system profile and user
profile are combined), or use them in a separated way.


Basic are shell, environment variables, and the effects of environment
variables.  Hope this helps!





reply via email to

[Prev in Thread] Current Thread [Next in Thread]