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: Tue, 29 Aug 2017 11:26:03 +0200 Message-ID: References: <871snzfl4s.fsf@gnu.org> <87a82mp2jq.fsf@gmail.com> <877exngapp.fsf@gnu.org> <87h8wrljxm.fsf@gmail.com> <20170829081016.n37zqzvfetpuvop4@abyayala> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="94eb2c09dbe613c78b0557e100c9" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dmcmc-0008UA-Jm for help-guix@gnu.org; Tue, 29 Aug 2017 05:26:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dmcmb-0005ND-3E for help-guix@gnu.org; Tue, 29 Aug 2017 05:26:06 -0400 Received: from mail-io0-x236.google.com ([2607:f8b0:4001:c06::236]:34231) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dmcma-0005My-Qv for help-guix@gnu.org; Tue, 29 Aug 2017 05:26:05 -0400 Received: by mail-io0-x236.google.com with SMTP id n71so15815425iod.1 for ; Tue, 29 Aug 2017 02:26:04 -0700 (PDT) In-Reply-To: <20170829081016.n37zqzvfetpuvop4@abyayala> 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 , help-guix --94eb2c09dbe613c78b0557e100c9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable That is what i mean yes Den 29. aug. 2017 10.10 skrev "ng0" : > Peter Mikkelsen transcribed 5.2K bytes: > > 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= ? > > What do you mean by that? > > I understand your sentence as providing a > default case of "guix system reconfigure (opt args) /etc/config.scm" > which then could be overwritten by explicitly stating a file? > > If this default location becomes configurable in the services, then > yes I am for this. I have no /etc/config.scm because I track my files > in git across systems, and templates for a system I am conceptualizing > and writing on will also not exist at /etc/config.scm (or at least not > at the moment). > Our default example case is /etc/config.scm but I find it easier if you > can not make a mistake by using the wrong file. > > so like a theoretical item in (operating-system) could be > (default-system-config "/home/user/.guix-profile/ > share/systems/hostname/config.scm") > which has overwritten the default of > (default-system-config "/etc/config.scm") > > which is then used by appropriate services making use of guix system > {build,reconfigure} > is that what you mean? > The very same argument (file name) is also used for various other guix > system > sub commands. > > > 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 th= e tip of > the > > > >>> day! > > > >> > > > >> Greetings to everyone at GHM! > > > >> > > > >>> But wait: we can already store the config file in the instantiate= d > > > >>> 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 confi= g > > > 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 t= he > > > system config the current system was reconfigured with. > > > > > > -- > > > Alex > > > > > > > > -- > ng0 > GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588 > GnuPG: https://n0is.noblogs.org/my-keys > https://www.infotropique.org https://krosos.org > --94eb2c09dbe613c78b0557e100c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
That is what i mean yes
<= br>
Den 29. aug. 2017 10.10 skrev "ng0"= <ng0@infotropique.org>:<= br type=3D"attribution">
Peter Mikkelsen tran= scribed 5.2K bytes:
> If this becomes default, would it make sense for 'guix system reco= nfigure'
> to be able to run without a configuration file and just use the defaul= t?

What do you mean by that?

I understand your sentence as providing a
default case of "guix system reconfigure (opt args) /etc/config.scm&qu= ot;
which then could be overwritten by explicitly stating a file?

If this default location becomes configurable in the services, then
yes I am for this. I have no /etc/config.scm because I track my files
in git across systems, and templates for a system I am conceptualizing
and writing on will also not exist at /etc/config.scm (or at least not
at the moment).
Our default example case is /etc/config.scm but I find it easier if you
can not make a mistake by using the wrong file.

so like a theoretical item in (operating-system) could be
(default-system-config "/home/user/.guix-profile/share/systems/ho= stname/config.scm")
which has overwritten the default of
(default-system-config "/etc/config.scm")

which is then used by appropriate services making use of guix system {build= ,reconfigure}
is that what you mean?
The very same argument (file name) is also used for various other guix syst= em
sub commands.

> 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.melire@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 th= e instantiated
> > >>> 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 &= #39;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-service-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`(("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
> > >>>
> > (current-source-location)
> > >>>=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 'filenam= e)))))
> > >>>=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 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 m= ake
> > this service the default one, so that we can always point a user = to the
> > system config the current system was reconfigured with.
> >
> > --
> > Alex
> >
> >

--
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://n0is.noblogs.org/my-keys
https://www.infotropique.org https://krosos.org
--94eb2c09dbe613c78b0557e100c9--