GNU bug report logs

#29706 GuixSD: Please add the ability to change shells for root

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Reply or subscribe to this bug. View this bug as an mbox, status mbox, or maintainer mbox

Report forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Thu, 14 Dec 2017 08:39:02 GMT) (full text, mbox, link).


Acknowledgement sent to BJH2017 <brentonhorne77@gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix@gnu.org. (Thu, 14 Dec 2017 08:39:03 GMT) (full text, mbox, link).


Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

From: BJH2017 <brentonhorne77@gmail.com>
To: bug-guix@gnu.org
Subject: GuixSD: Please add the ability to change shells for root
Date: Thu, 14 Dec 2017 18:38:26 +1000
[Message part 1 (text/plain, inline)]
Using the configuration file /etc/config.scm it is fairly straight forward
to change shells for a given user account on GuixSD 0.14.0, such as using:

(operating system
   (users (cons (user-account
                         (name "user")
                         ....
                         (shell "/run/current-system/profile/bin/zsh")))))

, but for root this is impossible. Is it possible this feature could be
added?
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Mon, 18 Dec 2017 22:19:02 GMT) (full text, mbox, link).


Message #8 received at 29706@debbugs.gnu.org (full text, mbox, reply):

From: ludo@gnu.org (Ludovic Courtès)
To: BJH2017 <brentonhorne77@gmail.com>
Cc: 29706@debbugs.gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Mon, 18 Dec 2017 23:18:47 +0100
Hi,

BJH2017 <brentonhorne77@gmail.com> skribis:

> Using the configuration file /etc/config.scm it is fairly straight forward
> to change shells for a given user account on GuixSD 0.14.0, such as using:
>
> (operating system
>    (users (cons (user-account
>                          (name "user")
>                          ....
>                          (shell "/run/current-system/profile/bin/zsh")))))
>
> , but for root this is impossible. Is it possible this feature could be
> added?

I just realized it’s actually possible: if you add an account with
UID 0, then that account is the root account.

So you can write:

  (operating-system
    ;; …
    (users (cons (user-account
                   (name "this-can-be-root-or-something-else")
                   (uid 0)
                   ;; …
                   (shell (file-append zsh "/bin/zsh")))
                 …)))

… and you get a root account with the chosen name and shell.

Does it work for you?

I’ve clarified the situation:

  https://git.savannah.gnu.org/cgit/guix.git/commit/?id=45f6211730157c50ade4dbf770e60871f1067ad6

Thanks,
Ludo’.




Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Tue, 19 Dec 2017 14:54:02 GMT) (full text, mbox, link).


Message #11 received at 29706@debbugs.gnu.org (full text, mbox, reply):

From: ludo@gnu.org (Ludovic Courtès)
To: BJH2017 <brentonhorne77@gmail.com>
Cc: 29706@debbugs.gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Tue, 19 Dec 2017 15:53:32 +0100
Please always keep the list Cc’d.

BJH2017 <brentonhorne77@gmail.com> skribis:

> No it doesn't, I have this at the moment:
>
>                 (name "root")
>                 (uid 0)
>                 (group "root")
>                 (home-directory "/root")
>                 (shell (file-append zsh "/bin/zsh")))
>
> and I get the error:
>
> guix system: error: failed to load '/etc/config.scm':
> /etc/config.scm:35:9: /etc/config.scm:35:9: Wrong number of arguments to
> #<procedure cons (_ _)>

‘cons’ adds an element to a list, so it takes two arguments:

  (cons account list)

as in:

  (cons (user-account …) %base-user-accounts)

HTH!

Ludo’.




Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Tue, 19 Dec 2017 15:03:01 GMT) (full text, mbox, link).


Message #14 received at submit@debbugs.gnu.org (full text, mbox, reply):

From: BJH2017 <brentonhorne77@gmail.com>
To: bug-guix@gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Wed, 20 Dec 2017 01:02:02 +1000
[Message part 1 (text/plain, inline)]
(thought I had CC'ed the group with my last comment but unfortunately gmail
doesn't do this by default, sorry)

Ya I do have %base-user-accounts in my config file here is what I had for
user accounts in full:

  (users (cons
              (user-account
                (name "root")
                (uid 0)
                (group "root")
                (supplementary-groups '("home-directory"))
                (home-directory "/root")
                (shell (file-append zsh "/bin/zsh")))
               (user-account
                (name "fusion809")
                (comment "Brenton Horne")
                (group "users")
                (supplementary-groups '("wheel" "netdev"
                                        "audio" "video"))
                (home-directory "/home/fusion809")
(shell "/run/current-system/profile/bin/zsh"))
               %base-user-accounts))

guessing the problem here is that I have two user-account fields?


On 20 December 2017 at 00:53, Ludovic Courtès <ludo@gnu.org> wrote:

> Please always keep the list Cc’d.
>
> BJH2017 <brentonhorne77@gmail.com> skribis:
>
> > No it doesn't, I have this at the moment:
> >
> >                 (name "root")
> >                 (uid 0)
> >                 (group "root")
> >                 (home-directory "/root")
> >                 (shell (file-append zsh "/bin/zsh")))
> >
> > and I get the error:
> >
> > guix system: error: failed to load '/etc/config.scm':
> > /etc/config.scm:35:9: /etc/config.scm:35:9: Wrong number of arguments to
> > #<procedure cons (_ _)>
>
> ‘cons’ adds an element to a list, so it takes two arguments:
>
>   (cons account list)
>
> as in:
>
>   (cons (user-account …) %base-user-accounts)
>
> HTH!
>
> Ludo’.
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Tue, 19 Dec 2017 15:27:02 GMT) (full text, mbox, link).


Message #17 received at 29706@debbugs.gnu.org (full text, mbox, reply):

From: Ricardo Wurmus <rekado@elephly.net>
To: BJH2017 <brentonhorne77@gmail.com>
Cc: 29706@debbugs.gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Tue, 19 Dec 2017 16:26:14 +0100
Hi,

>   (users (cons
>               (user-account
>                 (name "root")
>                 (uid 0)
>                 (group "root")
>                 (supplementary-groups '("home-directory"))
>                 (home-directory "/root")
>                 (shell (file-append zsh "/bin/zsh")))
>                (user-account
>                 (name "fusion809")
>                 (comment "Brenton Horne")
>                 (group "users")
>                 (supplementary-groups '("wheel" "netdev"
>                                         "audio" "video"))
>                 (home-directory "/home/fusion809")
> (shell "/run/current-system/profile/bin/zsh"))
>                %base-user-accounts))
>
> guessing the problem here is that I have two user-account fields?

Yes, “cons” takes a single item (its first argument) and prepends it to a
list (its second argument).  You can use “cons*” here, which prepends
more than one thing to a list.

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net






Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Tue, 19 Dec 2017 15:35:01 GMT) (full text, mbox, link).


Message #20 received at 29706@debbugs.gnu.org (full text, mbox, reply):

From: Alex Sassmannshausen <alex@pompo.co>
To: BJH2017 <brentonhorne77@gmail.com>
Cc: 29706@debbugs.gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Tue, 19 Dec 2017 16:34:43 +0100
Hi,

BJH2017 writes:

> (thought I had CC'ed the group with my last comment but unfortunately gmail doesn't do this by default, sorry)
>
> Ya I do have %base-user-accounts in my config file here is what I had for user accounts in full:
>
> (users (cons 
> (user-account
> (name "root")
> (uid 0)
> (group "root")
> (supplementary-groups '("home-directory"))
> (home-directory "/root")
> (shell (file-append zsh "/bin/zsh")))
> (user-account
> (name "fusion809")
> (comment "Brenton Horne")
> (group "users")
> (supplementary-groups '("wheel" "netdev"
> "audio" "video"))
> (home-directory "/home/fusion809")
> (shell "/run/current-system/profile/bin/zsh"))
> %base-user-accounts))
>
> guessing the problem here is that I have two user-account fields?

That's correct.  Either use:

(cons (user-account ...)
      (cons (user-account ...)
            %base-user-accounts))

Or

(cons* (user-account ...) (user-account ...) %base-user-accounts)

HTH,

Alex

> On 20 December 2017 at 00:53, Ludovic Courtès <ludo@gnu.org> wrote:
>
>  Please always keep the list Cc’d.
>
>  BJH2017 <brentonhorne77@gmail.com> skribis:
>
>  > No it doesn't, I have this at the moment:
>  >
>  > (name "root")
>  > (uid 0)
>  > (group "root")
>  > (home-directory "/root")
>  > (shell (file-append zsh "/bin/zsh")))
>  >
>  > and I get the error:
>  >
>  > guix system: error: failed to load '/etc/config.scm':
>  > /etc/config.scm:35:9: /etc/config.scm:35:9: Wrong number of arguments to
>  > #<procedure cons (_ _)>
>
>  ‘cons’ adds an element to a list, so it takes two arguments:
>
>  (cons account list)
>
>  as in:
>
>  (cons (user-account …) %base-user-accounts)
>
>  HTH!
>
>  Ludo’.





Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Tue, 19 Dec 2017 15:40:01 GMT) (full text, mbox, link).


Message #23 received at 29706@debbugs.gnu.org (full text, mbox, reply):

From: Leo Famulari <leo@famulari.name>
To: BJH2017 <brentonhorne77@gmail.com>
Cc: 29706@debbugs.gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Tue, 19 Dec 2017 10:39:13 -0500
[Message part 1 (text/plain, inline)]
On Wed, Dec 20, 2017 at 01:02:02AM +1000, BJH2017 wrote:
> (thought I had CC'ed the group with my last comment but unfortunately gmail
> doesn't do this by default, sorry)
> 
> Ya I do have %base-user-accounts in my config file here is what I had for
> user accounts in full:
> 
>   (users (cons
>               (user-account
>                 (name "root")
>                 (uid 0)
>                 (group "root")
>                 (supplementary-groups '("home-directory"))
>                 (home-directory "/root")
>                 (shell (file-append zsh "/bin/zsh")))
>                (user-account
>                 (name "fusion809")
>                 (comment "Brenton Horne")
>                 (group "users")
>                 (supplementary-groups '("wheel" "netdev"
>                                         "audio" "video"))
>                 (home-directory "/home/fusion809")
> (shell "/run/current-system/profile/bin/zsh"))
>                %base-user-accounts))
> 
> guessing the problem here is that I have two user-account fields?

Right, if you are adding more than one element to %base-user-accounts,
you'll need to use cons* instead of cons.

(users (cons* (user-account
                (name "root")
		...)
              (user-account
                (name "fusion809")
                ...)
              %base-user-accounts))
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix@gnu.org:
bug#29706; Package guix. (Tue, 19 Dec 2017 17:17:02 GMT) (full text, mbox, link).


Message #26 received at 29706@debbugs.gnu.org (full text, mbox, reply):

From: ludo@gnu.org (Ludovic Courtès)
To: BJH2017 <brentonhorne77@gmail.com>
Cc: 29706@debbugs.gnu.org
Subject: Re: bug#29706: GuixSD: Please add the ability to change shells for root
Date: Tue, 19 Dec 2017 18:16:27 +0100
Hello,

BJH2017 <brentonhorne77@gmail.com> skribis:

> Ya I do have %base-user-accounts in my config file here is what I had for
> user accounts in full:
>
>   (users (cons
>               (user-account
>                 (name "root")
>                 (uid 0)
>                 (group "root")
>                 (supplementary-groups '("home-directory"))
>                 (home-directory "/root")
>                 (shell (file-append zsh "/bin/zsh")))
>                (user-account
>                 (name "fusion809")
>                 (comment "Brenton Horne")
>                 (group "users")
>                 (supplementary-groups '("wheel" "netdev"
>                                         "audio" "video"))
>                 (home-directory "/home/fusion809")
> (shell "/run/current-system/profile/bin/zsh"))
>                %base-user-accounts))

Here ‘cons’ is given three arguments.  You should use ‘cons*’ instead.
To do that you’ll also need to add this line to the top of your file:

  (use-modules (srfi srfi-1))  ;for 'cons*'

HTH,
Ludo’.




Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Wed Apr 16 04:45:50 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.