anchor.diff:            if ! [ -e /root/.ssh/authorized_keys ]; then
                 echo "obtaining SSH key..."
                 mkdir -p /root/.ssh
  -              ${pkgs.curl}/bin/curl --retry 3 --retry-delay 0 --fail \
  -                -o /root/key.pub \
  -                http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
  +              $curl -o /root/key.pub http://169.254.169.254/1.0/meta-data/public-keys/0/openssh-key
                 if [ $? -eq 0 -a -e /root/key.pub ]; then
                     if ! grep -q -f /root/key.pub /root/.ssh/authorized_keys; then
                         cat /root/key.pub >> /root/.ssh/authorized_keys
  
positive.code:         '';
      };
  
  }
  
negative.code: 
        task = true;
  
        path = [ pkgs.curl ];
  
        script =
          ''
            curl="curl --retry 3 --retry-delay 0 --fail"
          
            echo "setting host name..."
            ${optionalString (config.networking.hostName == "") ''
              ${pkgs.nettools}/bin/hostname $($curl http://169.254.169.254/1.0/meta-data/hostname)
            ''}
  
            # Don't download the SSH key if it has already been injected
  