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: Mon, 28 Aug 2017 14:04:18 +0200 Message-ID: <877exngapp.fsf@gnu.org> References: <871snzfl4s.fsf@gnu.org> <87a82mp2jq.fsf@gmail.com> 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]:37662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmImK-0000De-HQ for help-guix@gnu.org; Mon, 28 Aug 2017 08:04:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmImE-0003MZ-TY for help-guix@gnu.org; Mon, 28 Aug 2017 08:04:28 -0400 In-Reply-To: <87a82mp2jq.fsf@gmail.com> (Mekeor Melire's message of "Sat, 26 Aug 2017 21:11:21 +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: Mekeor Melire Cc: help-guix Hi Mekeor, (I think you forgot to Cc: the list.) Mekeor Melire skribis: > Ludovic Court=C3=A8s writes: > >> Hello Guix! >> >> Following a discussion we had at the GHM today, here=E2=80=99s the tip o= f the >> day! > > Greetings to everyone at GHM! > >> But wait: we can already store the config file in the instantiated >> system! Here=E2=80=99s how: >> >> (operating-system >> ;; =E2=80=A6 >> (services (cons (simple-service 'store-my-config >> etc-service-type >> `(("config.scm" >> ,(local-file (assoc-ref >> (current-source-loc= ation) >> 'filename))))) >> =E2=80=A6))) >> >> 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 =E2=80=98current-source-location=E2=80=99 trick works as expected, nothing insurmountable. Ludo=E2=80=99.