diff options
| -rw-r--r-- | doc/guix.texi | 4 | ||||
| -rw-r--r-- | gnu/machine/hetzner.scm | 40 |
2 files changed, 28 insertions, 16 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index debe9b48a77..b194dab4b89 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -50569,6 +50569,10 @@ If specified, either a public key as returned by | |||
| 50569 | @code{string->public-key} or the path to the SSH public key to use to | 50569 | @code{string->public-key} or the path to the SSH public key to use to |
| 50570 | authenticate with the remote host. | 50570 | authenticate with the remote host. |
| 50571 | 50571 | ||
| 50572 | @item @code{user} (default: @code{"root"}) | ||
| 50573 | The user to use for SSH authentication for the @samp{guix deploy} | ||
| 50574 | command once the initial provisioning is complete. | ||
| 50575 | |||
| 50572 | @end table | 50576 | @end table |
| 50573 | 50577 | ||
| 50574 | When deploying a machine for the first time, the following steps are | 50578 | When deploying a machine for the first time, the following steps are |
diff --git a/gnu/machine/hetzner.scm b/gnu/machine/hetzner.scm index 07e62d24e33..b6a13ac8466 100644 --- a/gnu/machine/hetzner.scm +++ b/gnu/machine/hetzner.scm | |||
| @@ -85,6 +85,7 @@ | |||
| 85 | hetzner-configuration-server-type | 85 | hetzner-configuration-server-type |
| 86 | hetzner-configuration-ssh-key | 86 | hetzner-configuration-ssh-key |
| 87 | hetzner-configuration-ssh-public-key | 87 | hetzner-configuration-ssh-public-key |
| 88 | hetzner-configuration-user | ||
| 88 | hetzner-configuration? | 89 | hetzner-configuration? |
| 89 | hetzner-environment-type)) | 90 | hetzner-environment-type)) |
| 90 | 91 | ||
| @@ -268,7 +269,9 @@ Have you run 'guix archive --generate-key'?") | |||
| 268 | (lambda (value) | 269 | (lambda (value) |
| 269 | (if (string? value) (public-key-from-file value) value)))) | 270 | (if (string? value) (public-key-from-file value) value)))) |
| 270 | (ssh-key hetzner-configuration-ssh-key | 271 | (ssh-key hetzner-configuration-ssh-key |
| 271 | (default #f))) ; #f | string | 272 | (default #f)) ; #f | string |
| 273 | (user hetzner-configuration-user | ||
| 274 | (default "root"))) ;string | ||
| 272 | 275 | ||
| 273 | (define (hetzner-configuration-ssh-key-fingerprint config) | 276 | (define (hetzner-configuration-ssh-key-fingerprint config) |
| 274 | "Return the SSH public key fingerprint of CONFIG as a string." | 277 | "Return the SSH public key fingerprint of CONFIG as a string." |
| @@ -293,21 +296,26 @@ Have you run 'guix archive --generate-key'?") | |||
| 293 | ;; Get the operating system WITHOUT the provenance service to avoid a | 296 | ;; Get the operating system WITHOUT the provenance service to avoid a |
| 294 | ;; duplicate symlink conflict in the store. | 297 | ;; duplicate symlink conflict in the store. |
| 295 | (os ((@@ (gnu machine) %machine-operating-system) target))) | 298 | (os ((@@ (gnu machine) %machine-operating-system) target))) |
| 296 | (machine | 299 | (match-record config <hetzner-configuration> |
| 297 | (inherit target) | 300 | ( authorize? allow-downgrades? build-locally? user) |
| 298 | (operating-system | 301 | (machine |
| 299 | (if (hetzner-configuration-authorize? config) | 302 | (inherit target) |
| 300 | (operating-system-authorize os) | 303 | (operating-system |
| 301 | os)) | 304 | (if authorize? |
| 302 | (environment managed-host-environment-type) | 305 | (operating-system-authorize os) |
| 303 | (configuration | 306 | os)) |
| 304 | (machine-ssh-configuration | 307 | (environment managed-host-environment-type) |
| 305 | (allow-downgrades? (hetzner-configuration-allow-downgrades? config)) | 308 | (configuration |
| 306 | (authorize? (hetzner-configuration-authorize? config)) | 309 | (machine-ssh-configuration |
| 307 | (build-locally? (hetzner-configuration-build-locally? config)) | 310 | (allow-downgrades? allow-downgrades?) |
| 308 | (host-name (hetzner-server-public-ipv4 server)) | 311 | (authorize? authorize?) |
| 309 | (identity (hetzner-configuration-ssh-key config)) | 312 | (build-locally? build-locally?) |
| 310 | (system (hetzner-server-system server))))))) | 313 | (host-name (hetzner-server-public-ipv4 server)) |
| 314 | ;; XXX: match-record doesn't make use of custom accessors to obtain | ||
| 315 | ;; the value, so we can't bind SSH-KEY with it. | ||
| 316 | (identity (hetzner-configuration-ssh-key config)) | ||
| 317 | (system (hetzner-server-system server)) | ||
| 318 | (user user))))))) | ||
| 311 | 319 | ||
| 312 | (define (hetzner-machine-location machine) | 320 | (define (hetzner-machine-location machine) |
| 313 | "Find the location of MACHINE on the Hetzner API." | 321 | "Find the location of MACHINE on the Hetzner API." |
