home: services: ssh-agent: Remove host-side use of (shepherd support).
This is a followup to 2c2f382e75
, which
inadvertently pulled in (shepherd support) on the host side.
* gnu/home/services/ssh.scm (<home-ssh-agent-configuration>)[socket-directory]:
Change value to a gexp.
(home-ssh-agent-services): Change 'socket-file' and 'command' to a
gexp. Add 'modules' field to 'shepherd-service'.
* doc/guix.texi (Secure Shell): Adjust accordingly.
This commit is contained in:
parent
b9d891140a
commit
be7e2bf7eb
2 changed files with 9 additions and 10 deletions
|
@ -42511,7 +42511,7 @@ Available @code{home-ssh-agent-configuration} fields are:
|
||||||
@item @code{git} (default: @code{git}) (type: file-like)
|
@item @code{git} (default: @code{git}) (type: file-like)
|
||||||
The git package to use.
|
The git package to use.
|
||||||
|
|
||||||
@item @code{socket-directory} (default: @code{@env{XDG_RUNTIME_DIR}/ssh-agent"}) (type: string)
|
@item @code{socket-directory} (default: @code{@env{XDG_RUNTIME_DIR}/ssh-agent"}) (type: gexp)
|
||||||
The directory to write the ssh-agent's @file{socket} file.
|
The directory to write the ssh-agent's @file{socket} file.
|
||||||
|
|
||||||
@item @code{extra-options} (default: @code{'()})
|
@item @code{extra-options} (default: @code{'()})
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
#:select (object->camel-case-string))
|
#:select (object->camel-case-string))
|
||||||
#:autoload (gnu packages base) (glibc-utf8-locales)
|
#:autoload (gnu packages base) (glibc-utf8-locales)
|
||||||
#:use-module (gnu packages ssh)
|
#:use-module (gnu packages ssh)
|
||||||
#:use-module (shepherd support)
|
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
#:use-module (srfi srfi-34)
|
#:use-module (srfi srfi-34)
|
||||||
#:use-module (srfi srfi-35)
|
#:use-module (srfi srfi-35)
|
||||||
|
@ -271,7 +270,7 @@ client,@command{ssh}, and by other tools such as @command{guix deploy}.")
|
||||||
(openssh home-ssh-agent-openssh ;file-like
|
(openssh home-ssh-agent-openssh ;file-like
|
||||||
(default openssh))
|
(default openssh))
|
||||||
(socket-directory home-ssh-agent-socket-directory ;string
|
(socket-directory home-ssh-agent-socket-directory ;string
|
||||||
(default (string-append %user-runtime-dir "/ssh-agent")))
|
(default #~(string-append %user-runtime-dir "/ssh-agent")))
|
||||||
(extra-options home-ssh-agent-extra-options ;list of string
|
(extra-options home-ssh-agent-extra-options ;list of string
|
||||||
(default '())))
|
(default '())))
|
||||||
|
|
||||||
|
@ -281,20 +280,20 @@ client,@command{ssh}, and by other tools such as @command{guix deploy}.")
|
||||||
(($ <home-ssh-agent-configuration>
|
(($ <home-ssh-agent-configuration>
|
||||||
openssh socket-directory extra-options)
|
openssh socket-directory extra-options)
|
||||||
(let* ((ssh-agent (file-append openssh "/bin/ssh-agent"))
|
(let* ((ssh-agent (file-append openssh "/bin/ssh-agent"))
|
||||||
(socket-file (string-append socket-directory "/socket"))
|
(socket-file #~(string-append #$socket-directory "/socket"))
|
||||||
(command `(,ssh-agent
|
(command #~`(#$ssh-agent
|
||||||
"-D"
|
"-D" "-a" ,#$socket-file
|
||||||
"-a" ,socket-file
|
#$@extra-options))
|
||||||
,@extra-options))
|
(log-file #~(string-append %user-log-dir "/ssh-agent.log")))
|
||||||
(log-file (string-append %user-log-dir "/ssh-agent.log")))
|
|
||||||
(list (shepherd-service
|
(list (shepherd-service
|
||||||
(documentation "Run the ssh-agent.")
|
(documentation "Run the ssh-agent.")
|
||||||
(provision '(ssh-agent))
|
(provision '(ssh-agent))
|
||||||
|
(modules '((shepherd support))) ;for '%user-runtime-dir', etc.
|
||||||
(start #~(lambda _
|
(start #~(lambda _
|
||||||
(unless (file-exists? #$socket-directory)
|
(unless (file-exists? #$socket-directory)
|
||||||
(mkdir-p #$socket-directory)
|
(mkdir-p #$socket-directory)
|
||||||
(chmod #$socket-directory #o700))
|
(chmod #$socket-directory #o700))
|
||||||
(fork+exec-command '#$command #:log-file #$log-file)))
|
(fork+exec-command #$command #:log-file #$log-file)))
|
||||||
(stop #~(make-kill-destructor))))))))
|
(stop #~(make-kill-destructor))))))))
|
||||||
|
|
||||||
(define home-ssh-agent-service-type
|
(define home-ssh-agent-service-type
|
||||||
|
|
Reference in a new issue