1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

synergy: Add tests for config options

This commit is contained in:
Michael Hoang 2018-09-14 21:01:08 +10:00
parent 6d013ea166
commit 32d7297f98
2 changed files with 36 additions and 0 deletions

View file

@ -104,6 +104,7 @@ let
tests.services-ofborg = makeTest ./tests/services-ofborg.nix;
tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix;
tests.services-skhd = makeTest ./tests/services-skhd.nix;
tests.services-synergy = makeTest ./tests/services-synergy.nix;
tests.services-privoxy = makeTest ./tests/services-privoxy.nix;
tests.system-defaults-write = makeTest ./tests/system-defaults-write.nix;
tests.system-keyboard-mapping = makeTest ./tests/system-keyboard-mapping.nix;

View file

@ -0,0 +1,35 @@
{ config, lib, pkgs, ... }:
with lib;
let
synergy = pkgs.runCommand "synergy-0.0.0" {} "mkdir $out";
in
{
services.synergy.package = synergy;
services.synergy.client.enable = true;
services.synergy.client.screenName = "client_screenName";
services.synergy.client.serverAddress = "123.123.123.123:123";
services.synergy.server.enable = true;
services.synergy.server.configFile = "/tmp/synergy.conf";
services.synergy.server.screenName = "server_screenName";
services.synergy.server.address = "0.0.0.0:123";
test = ''
echo >&2 "checking synergy-client service in ~/Library/LaunchAgents"
grep "org.nixos.synergy-client" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-client.plist
grep "${synergy}/bin/synergyc" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-client.plist
grep "${config.services.synergy.client.screenName}" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-client.plist
grep "${config.services.synergy.client.serverAddress}" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-client.plist
echo >&2 "checking synergy-server service in ~/Library/LaunchAgents"
grep "org.nixos.synergy-server" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-server.plist
grep "${synergy}/bin/synergys" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-server.plist
grep "${config.services.synergy.server.configFile}" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-server.plist
grep "${config.services.synergy.server.screenName}" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-server.plist
grep "${config.services.synergy.server.address}" ${config.out}/user/Library/LaunchAgents/org.nixos.synergy-server.plist
'';
}