Subject: bug#50977: digital-ocean-environment-type fails

From: Florian Hoertlehner <[email-masked]>
Date: Sat, 2 Oct 2021 21:49:49 +0200

guix deploy leads to the following error:
https://api.digitalocean.com/v2/droplets: HTTP post failed: 422
("Unprocessable Entity")

The token that I use seems to be correct (there comes a different error
message when I define an invalid token).

This is the config file:

(use-modules
   (gnu services admin))

(use-service-modules networking ssh web)
(use-package-modules bootloaders ssh)

(define %system
  (operating-system
   (host-name "atlanticocean")
   (timezone "Etc/UTC")
   (bootloader (bootloader-configuration
                (bootloader grub-bootloader)
                (target "/dev/vda")
                (terminal-outputs '(console))))
   (file-systems (cons (file-system
                        (mount-point "/")
                        ;; Must be vda2 or you won't be able to reboot
after `guix deploy`.
                        ;; This is because our base image makes an EFI
partition at vda1.
                        (device "/dev/vda2")
                        (type "ext4"))
                       %base-file-systems))
   (services
    (append (list (service dhcp-client-service-type)
                  (service openssh-service-type
                           (openssh-configuration
                            (openssh openssh-sans-x)
                            (password-authentication? #false)
                            (permit-root-login #t)
                            (authorized-keys
                             ;; Authorise our SSH key.
                             `(("root" ,(local-file "id_rsa.pub"))))))
                  ;; Security updates, yes please!
                  (service unattended-upgrade-service-type)
                  ;; Note that Nginx isn't automatically restarted during
                  ;; `guix deploy`, so run `herd restart nginx`.
          )
            (modify-services %base-services
              ;; The server must trust the Guix packages you build. If you
add the signing-key
              ;; manually it will be overridden on next `guix deploy` giving
              ;; "error: unauthorized public key". This automatically adds
the signing-key.
              (guix-service-type config =>
                                 (guix-configuration
                                  (inherit config)
                                  (authorized-keys
                                   (append (list (local-file
"/etc/guix/signing-key.pub"))

 %default-authorized-guix-keys)))))))))

(define c-do
   (digital-ocean-configuration
       (region "nyc1")
       (size "s-1vcpu-1gb")
       (enable-ipv6? #f)
       (ssh-key "/home/f/repo/myLinux/data/ssh/f")
       (tags (list "ubuntu-s-1vcpu-1gb-nyc1-01"
       ))
       ))

(list (machine
       (operating-system %system)
       (environment digital-ocean-environment-type)
       (configuration c-do)))