guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#62461] Additional ssh configuration options.


From: Ludovic Courtès
Subject: [bug#62461] Additional ssh configuration options.
Date: Sat, 01 Apr 2023 09:59:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Nicolas Graves <ngraves@ngraves.fr> skribis:

> ---
>  gnu/home/services/ssh.scm | 49 ++++++++++++++++++++++++++++++++++-----
>  1 file changed, 43 insertions(+), 6 deletions(-)

[...]

> +(define ssh-match-keywords
> +  '("canonical" "final" "exec" "host" "originalhost" "user" "localuser"))

Should it be symbols?

>  (define-configuration openssh-host
>    (name
> -   (string)
> -   "Name of this host declaration.")
> +   maybe-string
> +   "Name of this host declaration.  A @code{openssh-host} must define only
> +@code{name} or @code{match-criteria}.  Use host-name \"*\" for top-level
> +options.")

“Use host name @code{\"*\"} for …”

> +  (match-criteria ;TODO implement stricter match-criteria rules
> +   maybe-match-criteria
> +   "A string where the first element is all or one of
> +@code{ssh-match-keywords}.  The rest of the elements are arguments for the

How about: “When specified, this string denotes the set of hosts to
which the entry applies, superseding the @code{host-name} field.  Its
first element must be all or one of…”

>    (string-append
> -   "Host " (openssh-host-name config) "\n"
> +   (if (maybe-value-set? (openssh-host-name config))
> +       (if (maybe-value-set? (openssh-host-match-criteria config))
> +           (error
> +            "You must either define name or match-criteria, not both.")
> +           (string-append "Host " (openssh-host-name config) "\n"))
> +       (if (maybe-value-set? (openssh-host-match-criteria config))
> +           (string-append
> +            "Match " (string-join (openssh-host-match-criteria config) " ") 
> "\n")
> +           (error
> +            "You must either define name or match-criteria once.")))

Please report errors as lowercase messages with:

  (raise (formatted-message (G_ "…") …))

You can also use ‘&fix-hint’ to provide an additional hint, if needed.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]