File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
tests/modules/services/ssh-agent Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 5454 Description = "SSH authentication agent" ;
5555 Documentation = "man:ssh-agent(1)" ;
5656 } ;
57- Service . ExecStart = "${ lib . getExe' cfg . package "ssh-agent" } -D -a %t/${ cfg . socket } ${
58- lib . optionalString (
59- cfg . defaultMaximumIdentityLifetime != null
60- ) " -t ${ toString cfg . defaultMaximumIdentityLifetime } "
61- } " ;
57+ Service = {
58+ ExecStart = "${ lib . getExe' cfg . package "ssh-agent" } -D -a %t/${ cfg . socket } ${
59+ lib . optionalString (
60+ cfg . defaultMaximumIdentityLifetime != null
61+ ) " -t ${ toString cfg . defaultMaximumIdentityLifetime } "
62+ } " ;
63+ ExecStartPost = "${ pkgs . writeShellScript "update-ssh-agent-env" ''
64+ if [ -z "$SSH_AUTH_SOCK" ]; then
65+ ${ pkgs . dbus } /bin/dbus-update-activation-environment --systemd "$@"
66+ fi
67+ '' } SSH_AUTH_SOCK=%t/${ cfg . socket } ";
68+ } ;
6269 } ;
6370 } ;
6471}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ WantedBy=default.target
33
44[Service]
55ExecStart =@openssh@/bin/ssh-agent -D -a %t/ssh-agent/socket
6+ ExecStartPost =/nix/store/00000000000000000000000000000000-update-ssh-agent-env SSH_AUTH_SOCK =%t/ssh-agent/socket
67
78[Unit]
89Description =SSH authentication agent
Original file line number Diff line number Diff line change 66
77 nmt . script = ''
88 assertFileContent \
9- home-files/.config/systemd/user/ssh-agent.service \
9+ $(normalizeStorePaths home-files/.config/systemd/user/ssh-agent.service) \
1010 ${ ./basic-service-expected.service }
1111 '' ;
1212}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ WantedBy=default.target
33
44[Service]
55ExecStart =@openssh@/bin/ssh-agent -D -a %t/ssh-agent -t 1337
6+ ExecStartPost =/nix/store/00000000000000000000000000000000-update-ssh-agent-env SSH_AUTH_SOCK =%t/ssh-agent
67
78[Unit]
89Description =SSH authentication agent
Original file line number Diff line number Diff line change 66
77 nmt . script = ''
88 assertFileContent \
9- home-files/.config/systemd/user/ssh-agent.service \
9+ $(normalizeStorePaths home-files/.config/systemd/user/ssh-agent.service) \
1010 ${ ./timeout-service-expected.service }
1111 '' ;
1212}
You can’t perform that action at this time.
0 commit comments