unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: 45mg <45mg.writes@gmail.com>
To: Tomas Volf <~@wolfsden.cz>
Cc: "Guix Devel" <guix-devel@gnu.org>,
	"Christopher Baines" <mail@cbaines.net>,
	"Ian Eure" <ian@retrospec.tv>,
	"František Boháček" <bohacfr2@fel.cvut.cz>
Subject: Docs: Clarify use-cases of `guix-for-channels`?
Date: Sat, 28 Dec 2024 02:14:51 -0500	[thread overview]
Message-ID: <87ed1scm8k.fsf@gmail.com> (raw)
In-Reply-To: <87h66o4xxg.fsf@wolfsden.cz>

Hi Tomas,

I finally understand that it's my use of `guix-for-channels` that's
making it pull when I reconfigure. So, my issue is solved by removing
the `(guix)` field from the `(guix-configuration)` form in the
configuration I posted.

All I was trying to do was specify additional channels in my system
configuration, without having to write anything in
~/.config/guix/channels.scm (I prefer for everything related to my
system configuration to be tracked by git in a single root-owned
directory). It looks like I only need the `(channels)` field of
`(guix-configuration)` for that. Is that correct?

This would have been obvious to me if I had understood what
`guix-for-channels` is actually /for/ from the start. The only reason I
ended up using it in the first place is that I was reading through
'(guix) Channels' to understand how to configure additional ones, and
then I saw this in '(guix) Customizing the System-Wide Guix':

> If you’re running Guix System or building system images with it, maybe
> you will want to customize the system-wide ‘guix’ it
> provides—specifically, ‘/run/current-system/profile/bin/guix’.  For
> example, you might want to provide additional channels or to pin its
> revision.
> 
>    This can be done using the ‘guix-for-channels’ procedure, which
> returns a package for the given channels, and using it as part of your
> operating system configuration, as in this example:
> 
>      (use-modules (gnu packages package-management)
>                   (guix channels))
> 
>      (define my-channels
>        ;; Channels that should be available to
>        ;; /run/current-system/profile/bin/guix.
>        (append
>         (list (channel
>                (name 'guix-science)
>                (url "https://github.com/guix-science/guix-science")
>                (branch "master")))
>         %default-channels))
> 
>      (operating-system
>        ;; ...
>        (services
>          ;; Change the package used by 'guix-service-type'.
>          (modify-services %base-services
>            (guix-service-type
>             config => (guix-configuration
>                        (inherit config)
>                        (channels my-channels)
>                        (guix (guix-for-channels my-channels)))))))
> 
>    The resulting operating system will have both the ‘guix’ and the
> ‘guix-science’ channels visible by default.  The ‘channels’ field of
> ‘guix-configuration’ above further ensures that
> ‘/etc/guix/channels.scm’, which is used by ‘guix pull’, specifies the
> same set of channels (*note ‘channels’ field of ‘guix-configuration’:
> guix-configuration-channels.).

If I had really been paying close attention, I would have noticed
phrasing like '/maybe/ you will want', and realised that using
`guix-for-channels` is /optional/. But since this subsection is under
the 'Channels' section of the manual, which explains the basics of using
channels - and does not provide any other snippet explaining how to
configure channels in the system configuration file - I assumed that the
code snippet quoted above is THE Official Way™ to configure additional
channels directly in the system configuration, without using
~/.config/guix/channels.scm; and copied it near-verbatim.

I think this could be clarified a little, so that other people who are
in a hurry to set things up for the first time don't make the same
mistake as me, and then think that Guix needs an internet connection
just to reconfigure the system.

I could write a patch to the manual for this. Here's what I'm proposing
to do:

- Add a snippet to '(guix) Specifying Additional Channels', explaining
  how to configure additional channels within the system configuration
  file (as per the second paragraph of this message).

- In '(guix) Customizing the System-Wide Guix', explain more clearly
  where `guix-for-channels` would be useful. As I understand it, the
  main use-case is for fresh system installations where running `guix
  pull` would be a hassle, such as on an installer ISO. Are there other
  significant use-cases? Any other reasons why one might want to use it
  on their main system, despite the hassle of it pulling every time and
  not caching the derivation? (We should also document that limitation,
  unless it's likely to change in the near future.)


  reply	other threads:[~2024-12-28  7:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-25 14:44 Why does `system reconfigure` need to `pull`? 45mg
2024-12-26 18:41 ` Ian Eure
2024-12-26 21:48 ` Christopher Baines
2024-12-27 19:58 ` 45mg
2024-12-27 21:29   ` Tomas Volf
2024-12-28  7:14     ` 45mg [this message]
2024-12-28 12:56       ` Docs: Clarify use-cases of `guix-for-channels`? Tomas Volf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ed1scm8k.fsf@gmail.com \
    --to=45mg.writes@gmail.com \
    --cc=bohacfr2@fel.cvut.cz \
    --cc=guix-devel@gnu.org \
    --cc=ian@retrospec.tv \
    --cc=mail@cbaines.net \
    --cc=~@wolfsden.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).