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: ng0
Subject: Re: Tip of the day: storing your GuixSD config in the instantiated system
Date: Tue, 29 Aug 2017 08:10:17 +0000

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" <address@hidden>:
> 
> > Ludovic Courtès (2017-08-28 14:04 +0200) wrote:
> >
> > > Hi Mekeor,
> > >
> > > (I think you forgot to Cc: the list.)
> > >
> > > Mekeor Melire <address@hidden> skribis:
> > >
> > >> Ludovic Courtès <address@hidden> writes:
> > >>
> > >>> Hello Guix!
> > >>>
> > >>> Following a discussion we had at the GHM today, here’s the tip of the
> > >>> day!
> > >>
> > >> Greetings to everyone at GHM!
> > >>
> > >>> 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.
> > >>
> > >> 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
> >
> >

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

Attachment: signature.asc
Description: PGP signature


reply via email to

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