services: openssh: Parameterize the OpenSSH package used by the service.
* gnu/services/ssh.scm (<openssh-configuration>)[openssh]: New field. (openssh-activation, openssh-shepherd-service): Use it.
This commit is contained in:
parent
613d0895b9
commit
23f22ba8af
|
@ -260,6 +260,8 @@ The other options should be self-descriptive."
|
||||||
(define-record-type* <openssh-configuration>
|
(define-record-type* <openssh-configuration>
|
||||||
openssh-configuration make-openssh-configuration
|
openssh-configuration make-openssh-configuration
|
||||||
openssh-configuration?
|
openssh-configuration?
|
||||||
|
(openssh openssh-configuration-openssh ;package
|
||||||
|
(default openssh))
|
||||||
(pid-file openssh-configuration-pid-file
|
(pid-file openssh-configuration-pid-file
|
||||||
(default "/var/run/sshd.pid"))
|
(default "/var/run/sshd.pid"))
|
||||||
(port-number openssh-configuration-port-number ;integer
|
(port-number openssh-configuration-port-number ;integer
|
||||||
|
@ -297,7 +299,8 @@ The other options should be self-descriptive."
|
||||||
(mkdir-p (dirname #$(openssh-configuration-pid-file config)))
|
(mkdir-p (dirname #$(openssh-configuration-pid-file config)))
|
||||||
|
|
||||||
;; Generate missing host keys.
|
;; Generate missing host keys.
|
||||||
(system* (string-append #$openssh "/bin/ssh-keygen") "-A")))
|
(system* (string-append #$(openssh-configuration-openssh config)
|
||||||
|
"/bin/ssh-keygen") "-A")))
|
||||||
|
|
||||||
(define (openssh-config-file config)
|
(define (openssh-config-file config)
|
||||||
"Return the sshd configuration file corresponding to CONFIG."
|
"Return the sshd configuration file corresponding to CONFIG."
|
||||||
|
@ -342,7 +345,7 @@ The other options should be self-descriptive."
|
||||||
(openssh-configuration-pid-file config))
|
(openssh-configuration-pid-file config))
|
||||||
|
|
||||||
(define openssh-command
|
(define openssh-command
|
||||||
#~(list (string-append #$openssh "/sbin/sshd")
|
#~(list (string-append #$(openssh-configuration-openssh config) "/sbin/sshd")
|
||||||
"-D" "-f" #$(openssh-config-file config)))
|
"-D" "-f" #$(openssh-config-file config)))
|
||||||
|
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
|
|
Loading…
Reference in New Issue