1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

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.
This commit is contained in:
Ludovic Courtès
2017-07-30 16:03:43 +02:00
parent 4892eb7c6a
commit 1398a43816
2 changed files with 22 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix modules)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
#:export (lsh-configuration
@@ -450,6 +451,13 @@ of user-name/file-like tuples."
#:allow-empty-passwords?
(openssh-configuration-allow-empty-passwords? config))))
(define (extend-openssh-authorized-keys config keys)
"Extend CONFIG with the extra authorized keys listed in KEYS."
(openssh-configuration
(inherit config)
(authorized-keys
(append (openssh-authorized-keys config) keys))))
(define openssh-service-type
(service-type (name 'openssh)
(extensions
@@ -461,6 +469,8 @@ of user-name/file-like tuples."
openssh-activation)
(service-extension account-service-type
(const %openssh-accounts))))
(compose concatenate)
(extend extend-openssh-authorized-keys)
(default-value (openssh-configuration))))