From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Mikkelsen Subject: Re: Tip of the day: storing your GuixSD config in the instantiated system Date: Mon, 28 Aug 2017 22:23:47 +0200 Message-ID: References: <871snzfl4s.fsf@gnu.org> <87a82mp2jq.fsf@gmail.com> <877exngapp.fsf@gnu.org> <87h8wrljxm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114490ce7b5e960557d6120e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmQZb-0002ys-KK for help-guix@gnu.org; Mon, 28 Aug 2017 16:23:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmQZa-000657-EX for help-guix@gnu.org; Mon, 28 Aug 2017 16:23:51 -0400 In-Reply-To: <87h8wrljxm.fsf@gmail.com> 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: Alex Kost Cc: help-guix --001a114490ce7b5e960557d6120e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable If this becomes default, would it make sense for 'guix system reconfigure' to be able to run without a configuration file and just use the default? Den 28. aug. 2017 18.46 skrev "Alex Kost" : > Ludovic Court=C3=A8s (2017-08-28 14:04 +0200) wrote: > > > 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 ti= p of 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-location) > >>> '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? > > I was going to write the same: I also think it would be good to make > this service the default one, so that we can always point a user to the > system config the current system was reconfigured with. > > -- > Alex > > --001a114490ce7b5e960557d6120e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
If this becomes default, would it make sense for 'gui= x system reconfigure' to be able to run without a configuration file an= d just use the default?

Den 28. aug. 2017 18.46 skrev "Alex Kost" <alezost@gmail.com>:
Ludovic Court=C3=A8s (2017-08-28 14:04= +0200) wrote:

> Hi Mekeor,
>
> (I think you forgot to Cc: the list.)
>
> Mekeor Melire <mekeor.me= lire@gmail.com> skribis:
>
>> Ludovic Court=C3=A8s <ludo@gnu.= org> writes:
>>
>>> Hello Guix!
>>>
>>> Following a discussion we had at the GHM today, here=E2=80=99s= the tip of the
>>> day!
>>
>> Greetings to everyone at GHM!
>>
>>> But wait: we can already store the config file in the instanti= ated
>>> system!=C2=A0 Here=E2=80=99s how:
>>>
>>>=C2=A0 =C2=A0(operating-system
>>>=C2=A0 =C2=A0 =C2=A0;; =E2=80=A6
>>>=C2=A0 =C2=A0 =C2=A0(services (cons (simple-service 'store-= my-config
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0etc-se= rvice-type
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`((&qu= ot;config.scm"
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ,(local-file (assoc-ref
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (current-source-locati= on)
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 'filename)))))
>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0=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 t= he 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 itse= lf.
>> What do you think?

I was going to write the same: I also think it would be good to make
this service the default one, so that we can always point a user to the
system config the current system was reconfigured with.

--
Alex

--001a114490ce7b5e960557d6120e--