6dc67b090156b631f274a3eb95e17f8c9c77fe1e
[jackhill/guix/guix.git] / gnu / system / examples / vm-image.tmpl
1 ;;; This is an operating system configuration template for a "bare-bones" setup,
2 ;;; suitable for booting in a virtualized environment, including virtual private
3 ;;; servers (VPS).
4
5 (use-modules (gnu))
6 (use-package-modules bootloaders disk nvi)
7
8 (define vm-image-motd (plain-file "motd" "
9 This is the GNU system. Welcome!
10
11 This instance of Guix System is a bare-bones template for virtualized environments.
12
13 You will probably want to do these things first if you booted in a virtual
14 private server (VPS):
15
16 * Set a password for 'root'.
17 * Set up networking.
18 * Expand the root partition to fill the space available by 0) deleting and
19 recreating the partition with fdisk, 1) reloading the partition table with
20 partprobe, and then 2) resizing the filesystem with resize2fs.\n"))
21
22 (operating-system
23 (host-name "gnu")
24 (timezone "Etc/UTC")
25 (locale "en_US.utf8")
26
27 (firmware '())
28
29 ;; Assuming /dev/sdX is the target hard disk, and "my-root" is
30 ;; the label of the target root file system.
31 (bootloader (bootloader-configuration
32 (bootloader grub-bootloader)
33 (target "/dev/sda")
34 (terminal-outputs '(console))))
35 (file-systems (cons (file-system
36 (device (file-system-label "my-root"))
37 (mount-point "/")
38 (type "ext4"))
39 %base-file-systems))
40
41 ;; This is where user accounts are specified. The "root"
42 ;; account is implicit, and is initially created with the
43 ;; empty password.
44 (users %base-user-accounts)
45
46 ;; Globally-installed packages.
47 (packages (append (list nvi fdisk
48 ;; mostly so xrefs to its manual work
49 grub
50 ;; partprobe
51 parted)
52 %base-packages))
53
54 (services (modify-services %base-services
55 (login-service-type config =>
56 (login-configuration
57 (inherit config)
58 (motd vm-image-motd))))))