mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-05 16:41:04 +01:00
ssh-agent: add macOS support
This commit is contained in:
parent
d7b1ece79d
commit
c053d701d6
15 changed files with 205 additions and 48 deletions
|
|
@ -0,0 +1,9 @@
|
|||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@openssh@/bin/ssh-agent -D -a %t/ssh-agent/socket
|
||||
|
||||
[Unit]
|
||||
Description=SSH authentication agent
|
||||
Documentation=man:ssh-agent(1)
|
||||
12
tests/modules/services/ssh-agent/linux/basic-service.nix
Normal file
12
tests/modules/services/ssh-agent/linux/basic-service.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
services.ssh-agent = {
|
||||
enable = true;
|
||||
socket = "ssh-agent/socket";
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/ssh-agent.service \
|
||||
${./basic-service-expected.service}
|
||||
'';
|
||||
}
|
||||
4
tests/modules/services/ssh-agent/linux/default.nix
Normal file
4
tests/modules/services/ssh-agent/linux/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
ssh-agent-basic-service = ./basic-service.nix;
|
||||
ssh-agent-timeout-service = ./timeout-service.nix;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@openssh@/bin/ssh-agent -D -a %t/ssh-agent -t 1337
|
||||
|
||||
[Unit]
|
||||
Description=SSH authentication agent
|
||||
Documentation=man:ssh-agent(1)
|
||||
12
tests/modules/services/ssh-agent/linux/timeout-service.nix
Normal file
12
tests/modules/services/ssh-agent/linux/timeout-service.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
services.ssh-agent = {
|
||||
enable = true;
|
||||
defaultMaximumIdentityLifetime = 1337;
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/ssh-agent.service \
|
||||
${./timeout-service-expected.service}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue