diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2015-05-25 16:54:05 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2015-05-25 21:34:23 +0200 |
| commit | bf87f38ace7f0cbad5558c1ef027b9f02988e393 (patch) | |
| tree | aebed4cf8d58d098beb8d6b0e00d2c434e20d8d9 | |
| parent | 0899144f797b5a660bee17427a7d07d70ba89bc4 (diff) | |
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.
| -rw-r--r-- | doc/guix.texi | 10 | ||||
| -rw-r--r-- | gnu/system.scm | 2 | ||||
| -rw-r--r-- | gnu/system/examples/bare-bones.tmpl | 5 | ||||
| -rw-r--r-- | gnu/system/examples/desktop.tmpl | 5 | ||||
| -rw-r--r-- | gnu/system/shadow.scm | 11 |
5 files changed, 27 insertions, 6 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index cfb626c7057..6507b9c4364 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'' | |||
| 4453 | (@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}). | 4453 | (@pxref{Memory Concepts,,, libc, The GNU C Library Reference Manual}). |
| 4454 | For example, @code{'("/dev/sda3")}. | 4454 | For example, @code{'("/dev/sda3")}. |
| 4455 | 4455 | ||
| 4456 | @item @code{users} (default: @code{'()}) | 4456 | @item @code{users} (default: @code{%base-user-accounts}) |
| 4457 | @itemx @code{groups} (default: @var{%base-groups}) | 4457 | @itemx @code{groups} (default: @var{%base-groups}) |
| 4458 | List of user accounts and groups. @xref{User Accounts}. | 4458 | List of user accounts and groups. @xref{User Accounts}. |
| 4459 | 4459 | ||
| @@ -4832,6 +4832,14 @@ to be present on the system. This includes groups such as ``root'', | |||
| 4832 | specific devices such as ``audio'', ``disk'', and ``cdrom''. | 4832 | specific devices such as ``audio'', ``disk'', and ``cdrom''. |
| 4833 | @end defvr | 4833 | @end defvr |
| 4834 | 4834 | ||
| 4835 | @defvr {Scheme Variable} %base-user-accounts | ||
| 4836 | This is the list of basic system accounts that programs may expect to | ||
| 4837 | find on a GNU/Linux system, such as the ``nobody'' account. | ||
| 4838 | |||
| 4839 | Note that the ``root'' account is not included here. It is a | ||
| 4840 | special-case and is automatically added whether or not it is specified. | ||
| 4841 | @end defvr | ||
| 4842 | |||
| 4835 | @node Locales | 4843 | @node Locales |
| 4836 | @subsection Locales | 4844 | @subsection Locales |
| 4837 | 4845 | ||
diff --git a/gnu/system.scm b/gnu/system.scm index 79de80a3ebf..c4a3bee0ebf 100644 --- a/gnu/system.scm +++ b/gnu/system.scm | |||
| @@ -119,7 +119,7 @@ | |||
| 119 | (default '())) | 119 | (default '())) |
| 120 | 120 | ||
| 121 | (users operating-system-users ; list of user accounts | 121 | (users operating-system-users ; list of user accounts |
| 122 | (default '())) | 122 | (default %base-user-accounts)) |
| 123 | (groups operating-system-groups ; list of user groups | 123 | (groups operating-system-groups ; list of user groups |
| 124 | (default %base-groups)) | 124 | (default %base-groups)) |
| 125 | 125 | ||
diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl index 8f4faca2d38..dc5cfc81a43 100644 --- a/gnu/system/examples/bare-bones.tmpl +++ b/gnu/system/examples/bare-bones.tmpl | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | ;; This is where user accounts are specified. The "root" | 23 | ;; This is where user accounts are specified. The "root" |
| 24 | ;; account is implicit, and is initially created with the | 24 | ;; account is implicit, and is initially created with the |
| 25 | ;; empty password. | 25 | ;; empty password. |
| 26 | (users (list (user-account | 26 | (users (cons (user-account |
| 27 | (name "alice") | 27 | (name "alice") |
| 28 | (comment "Bob's sister") | 28 | (comment "Bob's sister") |
| 29 | (group "users") | 29 | (group "users") |
| @@ -34,7 +34,8 @@ | |||
| 34 | ;; and access the webcam. | 34 | ;; and access the webcam. |
| 35 | (supplementary-groups '("wheel" | 35 | (supplementary-groups '("wheel" |
| 36 | "audio" "video")) | 36 | "audio" "video")) |
| 37 | (home-directory "/home/alice")))) | 37 | (home-directory "/home/alice")) |
| 38 | %base-user-accounts)) | ||
| 38 | 39 | ||
| 39 | ;; Globally-installed packages. | 40 | ;; Globally-installed packages. |
| 40 | (packages (cons tcpdump %base-packages)) | 41 | (packages (cons tcpdump %base-packages)) |
diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl index c78188eb61c..988b8f937f8 100644 --- a/gnu/system/examples/desktop.tmpl +++ b/gnu/system/examples/desktop.tmpl | |||
| @@ -20,13 +20,14 @@ | |||
| 20 | (type "ext4")) | 20 | (type "ext4")) |
| 21 | %base-file-systems)) | 21 | %base-file-systems)) |
| 22 | 22 | ||
| 23 | (users (list (user-account | 23 | (users (cons (user-account |
| 24 | (name "bob") | 24 | (name "bob") |
| 25 | (comment "Alice's brother") | 25 | (comment "Alice's brother") |
| 26 | (group "users") | 26 | (group "users") |
| 27 | (supplementary-groups '("wheel" "netdev" | 27 | (supplementary-groups '("wheel" "netdev" |
| 28 | "audio" "video")) | 28 | "audio" "video")) |
| 29 | (home-directory "/home/bob")))) | 29 | (home-directory "/home/bob")) |
| 30 | %base-user-accounts)) | ||
| 30 | 31 | ||
| 31 | ;; Add Xfce and Ratpoison; that allows us to choose | 32 | ;; Add Xfce and Ratpoison; that allows us to choose |
| 32 | ;; sessions using either of these at the log-in screen. | 33 | ;; sessions using either of these at the log-in screen. |
diff --git a/gnu/system/shadow.scm b/gnu/system/shadow.scm index a778b873063..aa976526787 100644 --- a/gnu/system/shadow.scm +++ b/gnu/system/shadow.scm | |||
| @@ -54,6 +54,7 @@ | |||
| 54 | default-skeletons | 54 | default-skeletons |
| 55 | skeleton-directory | 55 | skeleton-directory |
| 56 | %base-groups | 56 | %base-groups |
| 57 | %base-user-accounts | ||
| 57 | assert-valid-users/groups)) | 58 | assert-valid-users/groups)) |
| 58 | 59 | ||
| 59 | ;;; Commentary: | 60 | ;;; Commentary: |
| @@ -113,6 +114,16 @@ | |||
| 113 | (system-group (name "tape")) | 114 | (system-group (name "tape")) |
| 114 | (system-group (name "kvm"))))) ; for /dev/kvm | 115 | (system-group (name "kvm"))))) ; for /dev/kvm |
| 115 | 116 | ||
| 117 | (define %base-user-accounts | ||
| 118 | ;; List of standard user accounts. Note that "root" is a special case, so | ||
| 119 | ;; it's not listed here. | ||
| 120 | (list (user-account | ||
| 121 | (name "nobody") | ||
| 122 | (uid 65534) | ||
| 123 | (group "nogroup") | ||
| 124 | (home-directory "/var/empty") | ||
| 125 | (system? #t)))) | ||
| 126 | |||
| 116 | (define (default-skeletons) | 127 | (define (default-skeletons) |
| 117 | "Return the default skeleton files for /etc/skel. These files are copied by | 128 | "Return the default skeleton files for /etc/skel. These files are copied by |
| 118 | 'useradd' in the home directory of newly created user accounts." | 129 | 'useradd' in the home directory of newly created user accounts." |
