1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
| | ;; This vm image is meant to be used as an image template
;; to be deployed on cloud providers that use cloud-init.
(use-modules (gnu)
(guix)
(guix gexp)
(srfi srfi-1))
(use-service-modules cloud-init base networking ssh)
(use-package-modules admin bootloaders package-management python-web ssh)
(operating-system
(host-name "gnu")
(timezone "Etc/UTC")
(locale "en_US.utf8")
(keyboard-layout (keyboard-layout "us"))
(firmware '())
;; Below we assume /dev/vda is the VM's hard disk.
;; Adjust as needed.
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(targets '("/dev/vda"))
(terminal-outputs '(console))))
(file-systems (cons (file-system
(mount-point "/")
(device "/dev/vda1")
(type "ext4")) %base-file-systems))
;; The cloud-utils packages provides some utilities to allow
;; us to piggyback off ubuntu's cloud-init modules/integrations
;; without having to write guix specific functionality.
;;
;; The python-cloud-init package is not strictly required to be
;; in system-wide packages.
(packages (append (list cloud-utils python-cloud-init) %base-packages))
(services
(append (list (service cloud-init-service-type)
;; An example of extra configuration files. This specific
;; file is required for properly running cloud-init on DigitalOcean
;; (cloud-init-configuration (extra-configuration-files `
;; (("99-digitalocean.cfg" ,
;; (plain-file
;; "99-digitalocean.cfg"
;; "datasource_list: [ ConfigDrive, DigitalOcean, NoCloud, None ]"))))))
(service network-manager-service-type)
(service wpa-supplicant-service-type)
(service openssh-service-type
(openssh-configuration (openssh openssh-sans-x)
(permit-root-login #t))))
%base-services
;; Uncomment the following and replace the above to automatically add your guix
;; signing key to the vm for easy reconfiguration.
;; (modify-services %base-services
;; (guix-service-type config =>
;; (guix-configuration (inherit config)
;; (authorized-keys (append
;; (list (local-file
;; "/etc/guix/signing-key.pub"))
;; %default-authorized-guix-keys)))))))
)))
|