[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tip of the day: storing your GuixSD config in the instantiated syste
From: |
Alex Kost |
Subject: |
Re: Tip of the day: storing your GuixSD config in the instantiated system |
Date: |
Mon, 28 Aug 2017 19:41:15 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Ludovic Courtès (2017-08-25 22:27 +0200) wrote:
> 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?
Nice tip indeed, thanks!
--
Alex
Re: Tip of the day: storing your GuixSD config in the instantiated system,
Alex Kost <=
Re: Tip of the day: storing your GuixSD config in the instantiated system, Ricardo Wurmus, 2017/08/29
Re: Tip of the day: storing your GuixSD config in the instantiated system, Andreas Enge, 2017/08/29