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: Wed, 30 Aug 2017 00:20:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

Ricardo Wurmus <address@hidden> skribis:

> Ludovic Courtès <address@hidden> writes:
>
>> 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.
>
> When the system is “checked out” during boot, would it fail when
> /etc/config.scm already exists?  It certainly won’t just overwrite an
> existing /etc/config.scm.

Right, I think it’d fail gracelessly.

> Also, this $profile/etc/config.scm would be read-only.  So far we have
> encouraged people to store their configuration file at /etc/config.scm.
> If this service became a default then we probably should encourage
> people to store their system config file template under version control
> in the root user’s home directory (or similar), rather than recommending
> the file to be placed in /etc.

Yeah, it sounds like claiming this specific name, /etc/config.scm, is
likely to cause problems.  Unless the documentation for the new service
insists on it?

And yes, we should recommend putting config files under version-control,
regardless of whether we add this new service.

Ludo’.



reply via email to

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