diff options
| author | Leo Famulari <leo@famulari.name> | 2017-05-13 20:44:36 -0400 |
|---|---|---|
| committer | Leo Famulari <leo@famulari.name> | 2017-05-17 14:12:51 -0400 |
| commit | 4b236c88eaa690a045bc57b9c4d2acf44ae91f17 (patch) | |
| tree | 8421913d27e375c76deafd7c451f0fb7d4530906 /gnu/system/examples/vm-image.tmpl | |
| parent | 872a6fd98868d345443f04efdfd974d148c57f9d (diff) | |
maint: The 'release' target builds a VM image.
* gnu/system/examples/vm-image.tmpl: New file.
* Makefile.am (GUIXSD_VM_SYSTEMS, GUIXSD_VM_IMAGE_BASE,
GUIXSD_VM_IMAGE_SIZE): New variables.
(release): Add logic to build a VM image.
(EXAMPLES): Add 'gnu/system/examples/vm-image.tmpl'.
* doc/guix.texi (Running GuixSD in a VM, Installing GuixSD in a VM): Mention the
pre-built VM image.
Diffstat (limited to 'gnu/system/examples/vm-image.tmpl')
| -rw-r--r-- | gnu/system/examples/vm-image.tmpl | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl new file mode 100644 index 00000000000..57ac71c535c --- /dev/null +++ b/gnu/system/examples/vm-image.tmpl | |||
| @@ -0,0 +1,53 @@ | |||
| 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 GuixSD 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 | ;; Assuming /dev/sdX is the target hard disk, and "my-root" is | ||
| 28 | ;; the label of the target root file system. | ||
| 29 | (bootloader (grub-configuration (device "/dev/sda") | ||
| 30 | (terminal-outputs '(console)))) | ||
| 31 | (file-systems (cons (file-system | ||
| 32 | (device "my-root") | ||
| 33 | (title 'label) | ||
| 34 | (mount-point "/") | ||
| 35 | (type "ext4")) | ||
| 36 | %base-file-systems)) | ||
| 37 | |||
| 38 | ;; This is where user accounts are specified. The "root" | ||
| 39 | ;; account is implicit, and is initially created with the | ||
| 40 | ;; empty password. | ||
| 41 | (users %base-user-accounts) | ||
| 42 | |||
| 43 | ;; Globally-installed packages. | ||
| 44 | (packages (cons* nvi fdisk | ||
| 45 | grub ; mostly so xrefs to its manual work | ||
| 46 | parted ; partprobe | ||
| 47 | %base-packages)) | ||
| 48 | |||
| 49 | (services (modify-services %base-services | ||
| 50 | (login-service-type config => | ||
| 51 | (login-configuration | ||
| 52 | (inherit config) | ||
| 53 | (motd vm-image-motd)))))) | ||
