system: Define '%base-packages' and use it.

* gnu/system.scm (<operating-system>)[packages]: Change default value to
  %BASE-PACKAGES.
  (%base-packages): New variable.
* gnu/system/install.scm (installation-os): Use it when defining the
  'packages' field.
* doc/guix.texi (Using the Configuration System): Use %BASE-PACKAGES in
  example.  Remove now unneeded module imports.  Explain this.
This commit is contained in:
Ludovic Courtès 2014-06-04 14:59:24 +02:00
parent 39d4fde3bf
commit 6f436c54d6
4 changed files with 34 additions and 53 deletions

View File

@ -24,15 +24,7 @@
(use-modules (gnu) (use-modules (gnu)
(gnu packages zile)
(gnu packages xorg) (gnu packages xorg)
(gnu packages admin)
(gnu packages guile)
(gnu packages bash)
(gnu packages linux)
(gnu packages less)
(gnu packages tor)
(gnu packages package-management)
(gnu packages avahi) (gnu packages avahi)
(gnu services networking) (gnu services networking)
@ -98,7 +90,5 @@ You can log in as 'guest' or 'root' with no password.
(pam-services (pam-services
;; Explicitly allow for empty passwords. ;; Explicitly allow for empty passwords.
(base-pam-services #:allow-empty-passwords? #t)) (base-pam-services #:allow-empty-passwords? #t))
(packages (list bash coreutils findutils grep sed
procps psmisc less (packages (cons* xterm avahi %base-packages)))
guile-2.0 dmd guix util-linux inetutils avahi
xterm zile)))

View File

@ -3116,14 +3116,8 @@ Linux-Libre kernel, initial RAM disk, and boot loader looks like this:
@findex operating-system @findex operating-system
@lisp @lisp
(use-modules (gnu) ; for 'user-account', '%base-services', etc. (use-modules (gnu) ; for 'user-account', '%base-services', etc.
(gnu services ssh) ; for 'lsh-service' (gnu packages emacs) ; for 'emacs'
(gnu packages base) ; Coreutils, grep, etc. (gnu services ssh)) ; for 'lsh-service'
(gnu packages bash) ; Bash
(gnu packages admin) ; dmd, Inetutils
(gnu packages zile) ; Zile
(gnu packages less) ; less
(gnu packages guile) ; Guile
(gnu packages linux)) ; procps, psmisc
(define komputilo (define komputilo
(operating-system (operating-system
@ -3142,22 +3136,21 @@ Linux-Libre kernel, initial RAM disk, and boot loader looks like this:
(uid 1000) (gid 100) (uid 1000) (gid 100)
(comment "Bob's sister") (comment "Bob's sister")
(home-directory "/home/alice")))) (home-directory "/home/alice"))))
(packages (list coreutils bash guile-2.0 (packages (cons emacs %base-packages))
guix dmd
inetutils
findutils grep sed
procps psmisc
zile less))
(services (cons (lsh-service #:port 2222 #:allow-root-login? #t) (services (cons (lsh-service #:port 2222 #:allow-root-login? #t)
%base-services)))) %base-services))))
@end lisp @end lisp
This example should be self-describing. The @code{packages} field lists This example should be self-describing. The @code{packages} field lists
packages provided by the various @code{(gnu packages ...)} modules above packages that will be globally visible on the system, for all user
(@pxref{Package Modules}). These are the packages that will be globally accounts---i.e., in every user's @code{PATH} environment variable---in
visible on the system, for all user accounts---i.e., in every user's addition to the per-user profiles (@pxref{Invoking guix package}). The
@code{PATH} environment variable---in addition to the per-user profiles @var{%base-packages} variables provides all the tools one would expect
(@pxref{Invoking guix package}). for basic user and administrator tasks---including the GNU Core
Utilities, the GNU Networking Utilities, the GNU Zile lightweight text
editor, @command{find}, @command{grep}, etc. The example above adds
Emacs to those, taken from the @code{(gnu packages emacs)} module
(@pxref{Package Modules}).
@vindex %base-services @vindex %base-services
The @code{services} field lists @dfn{system services} to be made The @code{services} field lists @dfn{system services} to be made

View File

@ -28,6 +28,9 @@
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages package-management) #:use-module (gnu packages package-management)
#:use-module (gnu packages which)
#:use-module (gnu packages less)
#:use-module (gnu packages zile)
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services dmd) #:use-module (gnu services dmd)
#:use-module (gnu services base) #:use-module (gnu services base)
@ -59,7 +62,9 @@
operating-system-derivation operating-system-derivation
operating-system-profile operating-system-profile
operating-system-grub.cfg)) operating-system-grub.cfg
%base-packages))
;;; Commentary: ;;; Commentary:
;;; ;;;
@ -97,15 +102,7 @@
(default %default-issue)) (default %default-issue))
(packages operating-system-packages ; list of (PACKAGE OUTPUT...) (packages operating-system-packages ; list of (PACKAGE OUTPUT...)
(default (list coreutils ; or just PACKAGE (default %base-packages)) ; or just PACKAGE
grep
sed
findutils
guile
bash
(@ (gnu packages dmd) dmd)
guix
tzdata)))
(timezone operating-system-timezone) ; string (timezone operating-system-timezone) ; string
(locale operating-system-locale) ; string (locale operating-system-locale) ; string
@ -216,6 +213,16 @@ explicitly appear in OS."
;;; /etc. ;;; /etc.
;;; ;;;
(define %base-packages
;; Default set of packages globally visible. It should include anything
;; required for basic administrator tasks.
(list bash coreutils findutils grep sed
procps psmisc less zile
guile-final (@ (gnu packages admin) dmd) guix
util-linux inetutils isc-dhcp
net-tools ; XXX: remove when Inetutils suffices
module-init-tools kbd))
(define %default-issue (define %default-issue
;; Default contents for /etc/issue. ;; Default contents for /etc/issue.
" "

View File

@ -20,13 +20,8 @@
#:use-module (gnu) #:use-module (gnu)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (guix monads) #:use-module (guix monads)
#:use-module (gnu packages bash)
#:use-module (gnu packages less)
#:use-module (gnu packages linux) #:use-module (gnu packages linux)
#:use-module (gnu packages guile)
#:use-module (gnu packages admin)
#:use-module (gnu packages package-management) #:use-module (gnu packages package-management)
#:use-module (gnu packages zile)
#:use-module (gnu packages disk) #:use-module (gnu packages disk)
#:use-module (gnu packages texinfo) #:use-module (gnu packages texinfo)
#:export (installation-os)) #:export (installation-os))
@ -137,13 +132,9 @@ Use Alt-F2 for documentation.
;; Explicitly allow for empty passwords. ;; Explicitly allow for empty passwords.
(base-pam-services #:allow-empty-passwords? #t)) (base-pam-services #:allow-empty-passwords? #t))
(packages (list bash coreutils findutils grep sed (packages (cons* texinfo-4 ; for the standalone Info reader
procps psmisc less texinfo-4
guile-2.0 dmd guix util-linux
inetutils isc-dhcp net-tools
parted fdisk ddrescue parted fdisk ddrescue
module-init-tools kbd %base-packages))))
zile))))
;; Return it here so 'guix system' can consume it directly. ;; Return it here so 'guix system' can consume it directly.
installation-os installation-os