1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-12 20:11:06 +01:00
home-manager/tests/modules/services/yubikey-agent/darwin/service.nix
Austin Horstman 2c4f8cb7d6 tests/yubikey-agent: reorganize darwin and linux
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-06-22 23:58:37 -05:00

47 lines
1.3 KiB
Nix

{ config, ... }:
{
services.yubikey-agent = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@yubikey-agent@"; };
};
nmt.script = ''
serviceFile=LaunchAgents/org.nix-community.home.yubikey-agent.plist
assertFileExists "$serviceFile"
assertFileContent "$serviceFile" ${builtins.toFile "expected-agent.plist" ''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>Crashed</key>
<true/>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
<string>org.nix-community.home.yubikey-agent</string>
<key>ProcessType</key>
<string>Background</string>
<key>ProgramArguments</key>
<array>
<string>@yubikey-agent@/bin/yubikey-agent</string>
<string>-l</string>
<string>/tmp/yubikey-agent.sock</string>
</array>
<key>Sockets</key>
<dict>
<key>Listener</key>
<dict>
<key>SockPathMode</key>
<integer>384</integer>
<key>SockPathName</key>
<string>/tmp/yubikey-agent.sock</string>
</dict>
</dict>
</dict>
</plist>''}
'';
}