Subject: Re: bug#53672: [PATCH] guix system: 'describe' shows the running system, not the current one.

From: 宋文武 <[email-masked]>
Date: Tue, 01 Feb 2022 17:54:08 +0800

Ludovic Courtès <[email-masked]> writes:

> * guix/profiles.scm (generation-number): Add optional 'base-profile'
> parameter and use it.
> * guix/scripts/system.scm (process-command): Add "/run/current-system"
> as first argument to 'generation-number'.
> * doc/guix.texi (Invoking guix system): Clarify that 'guix system
> describe' shows the running system.
> ---
>  doc/guix.texi           | 14 +++++++++++++-
>  guix/profiles.scm       | 13 +++++++++----
>  guix/scripts/system.scm |  4 ++--
>  3 files changed, 24 insertions(+), 7 deletions(-)
>
> Hello!
>
> Having reconfigured my system, generation N was “current”.  I booted
> into generation N-1 and noticed that ‘guix system describe’ would
> still display generation N—the “current” generation, but not the one
> I’m actually running.
>
> I think it’s counter-intuitive so this patch changes that so that
> ‘guix system describe’ shows the “running” generation—which, in this
> case, is N-1.
>
> Objections? Thoughts?

Sound good to me!  Well, I think "current" and "running" are the same
thing, I'd call the 'profiles/system' one "latest", so my understand is:

1. /run/booted-system: the system generation booted by bootloader.

2. /run/current-system: the system generation current running, same as
   booted until we do a system 'reconfigure' or 'roll-back'.

3. /var/guix/profiles/system: always point to the latest system-*-link,
   the default one in the bootloader, changed by a system 'reconfigure'
   or 'roll-back'.

Please correct me if it's wrong, thank you!