vm-image.tmpl 2.0 KB

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