help-guix
[Top][All Lists]
Advanced

[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: Ludovic Courtès
Subject: Re: Tip of the day: storing your GuixSD config in the instantiated system
Date: Mon, 28 Aug 2017 14:04:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Hi Mekeor,

(I think you forgot to Cc: the list.)

Mekeor Melire <address@hidden> skribis:

> Ludovic Courtès <address@hidden> writes:
>
>> Hello Guix!
>>
>> Following a discussion we had at the GHM today, here’s the tip of the
>> day!
>
> Greetings to everyone at GHM!
>
>> 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.
>
> Because of the frequent demand for it, I think it would make sense to
> offer this as pre-defined service by default, as part of Guix itself.
> What do you think?

Why not, indeed.  I think this would have to be a macro so that the
‘current-source-location’ trick works as expected, nothing
insurmountable.

Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]