unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Tip of the day: storing your GuixSD config in the instantiated system
@ 2017-08-25 20:27 Ludovic Courtès
       [not found] ` <87a82mp2jq.fsf@gmail.com>
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Ludovic Courtès @ 2017-08-25 20:27 UTC (permalink / raw)
  To: help-guix

Hello Guix!

Following a discussion we had at the GHM today, here’s the tip of the day!

People often ask how they could store their GuixSD config alongside the
instantiated system in the store.  Guix maintainers usually grumpily
reply “nah, don’t do this, because the config file is not
self-contained, so that’s not good enough.”

But wait: we can already store the config file in the instantiated
system!  Here’s how:

  (operating-system
    ;; …
    (services (cons (simple-service 'store-my-config
                                    etc-service-type
                                    `(("config.scm"
                                       ,(local-file (assoc-ref
                                                     (current-source-location)
                                                     'filename)))))
                    …)))

You instantiate that, and then /etc/config.scm (aka.
/run/current-system/etc/config.scm,
aka. /var/guix/profiles/system/etc/config.scm) contains the config file.

Pretty neat no?

Enjoy!

Ludo’.

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

end of thread, other threads:[~2017-08-30 21:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-25 20:27 Tip of the day: storing your GuixSD config in the instantiated system Ludovic Courtès
     [not found] ` <87a82mp2jq.fsf@gmail.com>
2017-08-28 12:04   ` Ludovic Courtès
2017-08-28 16:46     ` Alex Kost
2017-08-28 20:23       ` Peter Mikkelsen
2017-08-29  8:10         ` ng0
2017-08-29  9:26           ` Peter Mikkelsen
2017-08-29 10:13         ` Ricardo Wurmus
2017-08-28 16:41 ` Alex Kost
2017-08-29 10:10 ` Ricardo Wurmus
2017-08-29 22:20   ` Ludovic Courtès
2017-08-29 10:30 ` Andreas Enge
2017-08-29 22:42   ` Ludovic Courtès
2017-08-30 16:07     ` Andreas Enge
2017-08-30 21:25       ` Ricardo Wurmus

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