unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55359: How do I extend openssh-service-type ?
       [not found] <87tu9xum2c.fsf@rdklein.fr>
@ 2022-05-11  7:37 ` Oleg Pykhalov
  2022-05-25 12:06   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Pykhalov @ 2022-05-11  7:37 UTC (permalink / raw)
  To: Edouard Klein; +Cc: 55359, help-guix

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

Hi,

Edouard Klein <edk@beaver-labs.com> 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

[…]

Seems like extend-openssh-authorized-keys procedure does not use keys
argument. We could fix it like:
--8<---------------cut here---------------start------------->8---
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
--8<---------------cut here---------------end--------------->8---


Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#55359: How do I extend openssh-service-type ?
  2022-05-11  7:37 ` bug#55359: How do I extend openssh-service-type ? Oleg Pykhalov
@ 2022-05-25 12:06   ` Ludovic Courtès
  2022-05-26  5:40     ` Oleg Pykhalov
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2022-05-25 12:06 UTC (permalink / raw)
  To: Oleg Pykhalov; +Cc: 55359, help-guix, Edouard Klein

Hi,

Oleg Pykhalov <go.wigust@gmail.com> 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!

Thanks,
Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#55359: How do I extend openssh-service-type ?
  2022-05-25 12:06   ` Ludovic Courtès
@ 2022-05-26  5:40     ` Oleg Pykhalov
  0 siblings, 0 replies; 3+ messages in thread
From: Oleg Pykhalov @ 2022-05-26  5:40 UTC (permalink / raw)
  To: 55359-done; +Cc: Ludovic Courtès, Edouard Klein

[-- Attachment #1: Type: text/plain, Size: 1398 bytes --]

Hi,

Ludovic Courtès <ludo@gnu.org> writes:

> Oleg Pykhalov <go.wigust@gmail.com> 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 <edk@beaver-labs.com> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-26  5:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87tu9xum2c.fsf@rdklein.fr>
2022-05-11  7:37 ` bug#55359: How do I extend openssh-service-type ? Oleg Pykhalov
2022-05-25 12:06   ` Ludovic Courtès
2022-05-26  5:40     ` Oleg Pykhalov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).