help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple reconfigure


From: Chris Marusich
Subject: Re: Simple reconfigure
Date: Fri, 27 Apr 2018 22:01:33 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Hi Jone,

Jone <address@hidden> writes:

> Hello! If I make little changes, like such:
> was:
>
>   (users (cons (user-account
>                 (name "jone")
>                 (comment "Jone")
>                 (group "users")
>                 (supplementary-groups '("wheel" "netdev" "audio" "video"))
>                 (home-directory "/home/jone"))
>                %base-user-accounts))
>
> now:
>
>   (users (cons (user-account
>                 (name "jone")
>                 (comment "Jone")
>                 (group "users")
>                 (supplementary-groups '("wheel" "netdev" "audio" "video"))
>                 (home-directory "/home/jone"))
>                          (user-account
>                               (name "guest")
>                               (comment "Guest")
>                               (password "guest" "something")
>                               (group "users")
>                               (supplementary-groups '("netdev" "audio" 
> "video"))
>                               (home-directory "/home/guest"))
>                %base-user-accounts))
>
> as will be correct: just run 'guix system reconfigure' without options,
> or .. ? Can Guix only update configuration files, offline?

Suppose you have an operating system configuration file "config.scm".
In most cases, after you modify it, all you need to do is run "guix
system reconfigure config.scm" as root.  When you do that, Guix will
build a new system generation and make it current.  This includes
installing the bootloader and activating new services.  If you've added
a new user to config.scm, then Guix will create the user and its home
directory when you run "guix system reconfigure".

However, "guix system reconfigure" does not verify that you can boot
successfully into the new system generation, and it does not upgrade
services that are currently running (e.g., ssh-daemon).  Therefore, to
gain confidence in your new system generation, you might want to try
reboot after running "guix system reconfigure".  If the new system
generation boots successfully and all its services start up
successfully, then all is well.  If there is a problem, you can always
return to the previous generation by selecting it at boot time from the
bootloader menu.  Alternatively, you can invoke "guix system roll-back"
from the running system, and then reboot.

For more details, check out (guix) Invoking guix system in the manual.

By the way, in your example above, you need to use cons* instead of
cons.  You must write it like this:

  (cons* (user-account
          (name "jone")
          (comment "Jone")
          (group "users")
          (supplementary-groups '("wheel" "netdev" "audio" "video"))
          (home-directory "/home/jone"))
         (user-account
          (name "guest")
          (comment "Guest")
          (password "guest" "something")
          (group "users")
          (supplementary-groups '("netdev" "audio" "video"))
          (home-directory "/home/guest"))
         %base-user-accounts)

You can only pass two arguments to cons, but you can pass more than two
arguments to cons*.  If you use cons* here, it will return a list that
contains a user account for Jone, a user account for Guest, and all the
user accounts that appear in %base-user-accounts.  For more information,
please refer to the sections titled "Pairs" and "List Constructors" in
the Guile manual.

I hope that helps!

-- 
Chris

Attachment: signature.asc
Description: PGP signature


reply via email to

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