guix-commits
[Top][All Lists]
Advanced

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

01/04: system: Define '%base-user-accounts'.


From: Ludovic Courtès
Subject: 01/04: system: Define '%base-user-accounts'.
Date: Mon, 25 May 2015 19:39:02 +0000

civodul pushed a commit to branch master
in repository guix.

commit bf87f38ace7f0cbad5558c1ef027b9f02988e393
Author: Ludovic Courtès <address@hidden>
Date:   Mon May 25 16:54:05 2015 +0200

    system: Define '%base-user-accounts'.
    
    * gnu/system/shadow.scm (%base-user-accounts): New variable.
    * gnu/system.scm (<operating-system>)[users]: Use it as the default value.
    * gnu/system/examples/bare-bones.tmpl (users): Use it.
    * gnu/system/examples/desktop.tmpl (users): Likewise.
    * doc/guix.texi (operating-system Reference, User Accounts): Adjust
      accordingly.
---
 doc/guix.texi                       |   10 +++++++++-
 gnu/system.scm                      |    2 +-
 gnu/system/examples/bare-bones.tmpl |    5 +++--
 gnu/system/examples/desktop.tmpl    |    5 +++--
 gnu/system/shadow.scm               |   11 +++++++++++
 5 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index cfb626c..6507b9c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4453,7 +4453,7 @@ A list of strings identifying devices to be used for 
``swap space''
 (@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}).
 For example, @code{'("/dev/sda3")}.
 
address@hidden @code{users} (default: @code{'()})
address@hidden @code{users} (default: @code{%base-user-accounts})
 @itemx @code{groups} (default: @var{%base-groups})
 List of user accounts and groups.  @xref{User Accounts}.
 
@@ -4832,6 +4832,14 @@ to be present on the system.  This includes groups such 
as ``root'',
 specific devices such as ``audio'', ``disk'', and ``cdrom''.
 @end defvr
 
address@hidden {Scheme Variable} %base-user-accounts
+This is the list of basic system accounts that programs may expect to
+find on a GNU/Linux system, such as the ``nobody'' account.
+
+Note that the ``root'' account is not included here.  It is a
+special-case and is automatically added whether or not it is specified.
address@hidden defvr
+
 @node Locales
 @subsection Locales
 
diff --git a/gnu/system.scm b/gnu/system.scm
index 79de80a..c4a3bee 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -119,7 +119,7 @@
                 (default '()))
 
   (users operating-system-users                   ; list of user accounts
-         (default '()))
+         (default %base-user-accounts))
   (groups operating-system-groups                 ; list of user groups
           (default %base-groups))
 
diff --git a/gnu/system/examples/bare-bones.tmpl 
b/gnu/system/examples/bare-bones.tmpl
index 8f4faca..dc5cfc8 100644
--- a/gnu/system/examples/bare-bones.tmpl
+++ b/gnu/system/examples/bare-bones.tmpl
@@ -23,7 +23,7 @@
   ;; This is where user accounts are specified.  The "root"
   ;; account is implicit, and is initially created with the
   ;; empty password.
-  (users (list (user-account
+  (users (cons (user-account
                 (name "alice")
                 (comment "Bob's sister")
                 (group "users")
@@ -34,7 +34,8 @@
                 ;; and access the webcam.
                 (supplementary-groups '("wheel"
                                         "audio" "video"))
-                (home-directory "/home/alice"))))
+                (home-directory "/home/alice"))
+               %base-user-accounts))
 
   ;; Globally-installed packages.
   (packages (cons tcpdump %base-packages))
diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl
index c78188e..988b8f9 100644
--- a/gnu/system/examples/desktop.tmpl
+++ b/gnu/system/examples/desktop.tmpl
@@ -20,13 +20,14 @@
                         (type "ext4"))
                       %base-file-systems))
 
-  (users (list (user-account
+  (users (cons (user-account
                 (name "bob")
                 (comment "Alice's brother")
                 (group "users")
                 (supplementary-groups '("wheel" "netdev"
                                         "audio" "video"))
-                (home-directory "/home/bob"))))
+                (home-directory "/home/bob"))
+               %base-user-accounts))
 
   ;; Add Xfce and Ratpoison; that allows us to choose
   ;; sessions using either of these at the log-in screen.
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm
index a778b87..aa97652 100644
--- a/gnu/system/shadow.scm
+++ b/gnu/system/shadow.scm
@@ -54,6 +54,7 @@
             default-skeletons
             skeleton-directory
             %base-groups
+            %base-user-accounts
             assert-valid-users/groups))
 
 ;;; Commentary:
@@ -113,6 +114,16 @@
           (system-group (name "tape"))
           (system-group (name "kvm")))))             ; for /dev/kvm
 
+(define %base-user-accounts
+  ;; List of standard user accounts.  Note that "root" is a special case, so
+  ;; it's not listed here.
+  (list (user-account
+         (name "nobody")
+         (uid 65534)
+         (group "nogroup")
+         (home-directory "/var/empty")
+         (system? #t))))
+
 (define (default-skeletons)
   "Return the default skeleton files for /etc/skel.  These files are copied by
 'useradd' in the home directory of newly created user accounts."



reply via email to

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