all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Elais Player" <elais@fastmail.com>
To: guix-devel@gnu.org
Subject: Declaring channel dependencies in the operating-system configuration
Date: Fri, 04 Dec 2020 16:22:18 -0600	[thread overview]
Message-ID: <af731219-5126-4f79-9a2f-4db6d15c685d@www.fastmail.com> (raw)
In-Reply-To: <87czzpqplw.fsf@ambrevar.xyz>

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

Hi Guix!

One thing that I've often found to be annoying was manually adding a
channels.scm file to systems, and I've come up with a solution that I'd like to
share.

For those interested in having their channels.scm be added as part of the system
generation process, just do the following.

Create an object representing a scheme file using the `scheme-file` procedure

(define %guix-channels
  (scheme-file
        "channels.scm"
        #~(cons* (channel
                        (name 'example)
                        (url "https://example.org/channel.git"))
                 %default-channels)))

Then add the file-like object to your system services using the
extra-special-file procedure. It symlinks a file from the store to
/etc/guix/channels.scm and makes the channels declared there available to all of
your systems users.

(operating-system
  ...
  (services
    (cons*
      (extra-special-file "/etc/guix/channels.scm"
                          %guix-channels)
      %base-services)))

I think this is a pretty neat solution for those of us who need to use custom
channels, but I was wondering if this is something that can be improved on and
added to the top level operating-system declaration.

Just like we can declare hosts for the operating system would it be a good idea
to declare (channels #~(cons* (channel ...))) too?

Would it make sense to add it as a configuration in guix-service-type?

[-- Attachment #2: Type: text/html, Size: 2756 bytes --]

      reply	other threads:[~2020-12-04 22:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 20:47 PhD position in the area of secure software supply chain Julien Lepiller
2020-12-04 10:26 ` zimoun
2020-12-04 20:32 ` Pierre Neidhardt
2020-12-04 22:22   ` Elais Player [this message]

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

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

  git send-email \
    --in-reply-to=af731219-5126-4f79-9a2f-4db6d15c685d@www.fastmail.com \
    --to=elais@fastmail.com \
    --cc=guix-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.