vm-image.tmpl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. (firmware '())
  21. ;; Assuming /dev/sdX is the target hard disk, and "my-root" is
  22. ;; the label of the target root file system.
  23. (bootloader (bootloader-configuration
  24. (bootloader grub-bootloader)
  25. (target "/dev/sda")
  26. (terminal-outputs '(console))))
  27. (file-systems (cons (file-system
  28. (device (file-system-label "my-root"))
  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 (append (list nvi fdisk
  38. ;; mostly so xrefs to its manual work
  39. grub
  40. ;; partprobe
  41. parted)
  42. %base-packages))
  43. (services (modify-services %base-services
  44. (login-service-type config =>
  45. (login-configuration
  46. (inherit config)
  47. (motd vm-image-motd))))))