[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Declaring channel dependencies in the operating-system configuration
From: |
Elais Player |
Subject: |
Declaring channel dependencies in the operating-system configuration |
Date: |
Fri, 04 Dec 2020 16:22:18 -0600 |
User-agent: |
Cyrus-JMAP/3.3.0-622-g4a97c0b-fm-20201115.001-g4a97c0b3 |
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)
%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?