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 8686 Description = "SSH authentication agent" ;
8787 Documentation = "man:ssh-agent(1)" ;
8888 } ;
89- Service . ExecStart = "${ lib . getExe' cfg . package "ssh-agent" } -D -a %t/${ cfg . socket } ${
90- lib . optionalString (
91- cfg . defaultMaximumIdentityLifetime != null
92- ) " -t ${ toString cfg . defaultMaximumIdentityLifetime } "
93- } " ;
89+ Service = {
90+ ExecStart = "${ lib . getExe' cfg . package "ssh-agent" } -D -a %t/${ cfg . socket } ${
91+ lib . optionalString (
92+ cfg . defaultMaximumIdentityLifetime != null
93+ ) " -t ${ toString cfg . defaultMaximumIdentityLifetime } "
94+ } " ;
95+ ExecStartPost = "${ pkgs . writeShellScript "update-ssh-agent-env" ''
96+ if [ -z "$SSH_AUTH_SOCK" ]; then
97+ ${ pkgs . dbus } /bin/dbus-update-activation-environment --systemd "$@"
98+ fi
99+ '' } SSH_AUTH_SOCK=%t/${ cfg . socket } ";
100+ } ;
94101 } ;
95102 } ;
96103}
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