Subject: Re: bug#55359: How do I extend openssh-service-type ?
From: Oleg Pykhalov <[email-masked]>
To: [email-masked]
Cc: Ludovic Courtès <[email-masked]>, Edouard Klein <[email-masked]>
Date: Thu, 26 May 2022 08:40:07 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Ludovic Courtès <[email-masked]> writes:

> Oleg Pykhalov <[email-masked]> skribis:
>
>> Seems like extend-openssh-authorized-keys procedure does not use keys
>> argument. We could fix it like:
>>
>> diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm
>> index 7fbbe383e5..4bb3969b95 100644
>> --- a/gnu/services/ssh.scm
>> +++ b/gnu/services/ssh.scm
>> @@ -558,7 +558,7 @@ (define (extend-openssh-authorized-keys config keys)
>>    (openssh-configuration
>>     (inherit config)
>>     (authorized-keys
>> -    (match (openssh-configuration-authorized-keys config)
>> +    (match (append (openssh-configuration-authorized-keys config) keys)
>>        (((users _ ...) ...)
>>         ;; Build a user/key-list mapping.
>>         (let ((user-keys (alist->vhash
>
> Indeed.  Please push!

Pushed as 1f29ed4a812f86c45e2d9c37fd9f80f6d0418293.

> Edouard Klein <[email-masked]> writes:
>
> I'm trying to make sense of:
> https://guix.gnu.org/manual/en/guix.html#index-openssh_002dservice_002dtype
>
> #+begin_quote
> This service can be extended with extra authorized keys, as in this example:
>
> (service-extension openssh-service-type
>                    (const `(("charlie"
>                              ,(local-file "charlie.pub")))))
> #+end_quote

Edouard, you should be able to extend the service after the ‘guix pull’.

Oleg.