diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2017-07-30 16:03:43 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2017-07-30 16:23:19 +0200 |
| commit | 1398a43816011c435fb6723154dbf1d3414b5b3d (patch) | |
| tree | 8d620776214b52974d7d172644d8bbdd8d48245a /gnu/services/ssh.scm | |
| parent | 4892eb7c6a21416f3a18e18ca17984e2b66050ad (diff) | |
services: openssh: Extensions provide extra authorized keys.
* gnu/services/ssh.scm (extend-openssh-authorized-keys): New procedure.
(openssh-service-type)[compose, extend]: New fields.
* doc/guix.texi (Networking Services): Document the extension.
Diffstat (limited to 'gnu/services/ssh.scm')
| -rw-r--r-- | gnu/services/ssh.scm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 08635af16d4..697bb1b82e0 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #:use-module (guix gexp) | 29 | #:use-module (guix gexp) |
| 30 | #:use-module (guix records) | 30 | #:use-module (guix records) |
| 31 | #:use-module (guix modules) | 31 | #:use-module (guix modules) |
| 32 | #:use-module (srfi srfi-1) | ||
| 32 | #:use-module (srfi srfi-26) | 33 | #:use-module (srfi srfi-26) |
| 33 | #:use-module (ice-9 match) | 34 | #:use-module (ice-9 match) |
| 34 | #:export (lsh-configuration | 35 | #:export (lsh-configuration |
| @@ -450,6 +451,13 @@ of user-name/file-like tuples." | |||
| 450 | #:allow-empty-passwords? | 451 | #:allow-empty-passwords? |
| 451 | (openssh-configuration-allow-empty-passwords? config)))) | 452 | (openssh-configuration-allow-empty-passwords? config)))) |
| 452 | 453 | ||
| 454 | (define (extend-openssh-authorized-keys config keys) | ||
| 455 | "Extend CONFIG with the extra authorized keys listed in KEYS." | ||
| 456 | (openssh-configuration | ||
| 457 | (inherit config) | ||
| 458 | (authorized-keys | ||
| 459 | (append (openssh-authorized-keys config) keys)))) | ||
| 460 | |||
| 453 | (define openssh-service-type | 461 | (define openssh-service-type |
| 454 | (service-type (name 'openssh) | 462 | (service-type (name 'openssh) |
| 455 | (extensions | 463 | (extensions |
| @@ -461,6 +469,8 @@ of user-name/file-like tuples." | |||
| 461 | openssh-activation) | 469 | openssh-activation) |
| 462 | (service-extension account-service-type | 470 | (service-extension account-service-type |
| 463 | (const %openssh-accounts)))) | 471 | (const %openssh-accounts)))) |
| 472 | (compose concatenate) | ||
| 473 | (extend extend-openssh-authorized-keys) | ||
| 464 | (default-value (openssh-configuration)))) | 474 | (default-value (openssh-configuration)))) |
| 465 | 475 | ||
| 466 | 476 | ||
