From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Tip of the day: storing your GuixSD config in the instantiated system Date: Wed, 30 Aug 2017 00:42:51 +0200 Message-ID: <87efruov10.fsf@gnu.org> References: <871snzfl4s.fsf@gnu.org> <20170829103019.GA1516@jurong> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmpDi-0004Ac-SH for help-guix@gnu.org; Tue, 29 Aug 2017 18:42:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmpDi-00077C-3g for help-guix@gnu.org; Tue, 29 Aug 2017 18:42:54 -0400 In-Reply-To: <20170829103019.GA1516@jurong> (Andreas Enge's message of "Tue, 29 Aug 2017 12:30:19 +0200") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Andreas Enge Cc: help-guix Andreas Enge skribis: > On Fri, Aug 25, 2017 at 10:27:47PM +0200, Ludovic Court=C3=A8s wrote: >> But wait: we can already store the config file in the instantiated >> system! Here=E2=80=99s how: > > That is an exciting trick, thank you, Ludovic! > > As for making it a "default", this could be done in two ways: > - Add it as a service to %base-services. This wouldn=E2=80=99t be possible, at least not this easily, because the tr= ick requires the config file name, and that means it=E2=80=99d typically need t= o be a macro used within the config file, like: (define (%config-file-service file) (simple-service 'config-file etc-service-type `(("config.scm" ,file)))) (define-syntax-rule (config-file-service) (%config-file-service (local-file (assoc-ref (current-source-location) 'filename)))) > - Add it to the configuration templates. > I am more in favour of the first option, as it puts less clutter into > the configuration file. I=E2=80=99m a bit reluctant to make it part of =E2=80=98%base-services=E2= =80=99 (if it were technically possible) because that may deceive users, since it takes more than this config file to reproduce a GuixSD config. Ludo=E2=80=99.