1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-06 00:37:00 +00:00
nix-darwin/tests/buildkite-agent.nix
2018-02-26 18:19:22 +00:00

24 lines
782 B
Nix

{ config, pkgs, ... }:
let
tokenPath = pkgs.writeText "buildkite_token" "TEST_TOKEN";
in {
services.buildkite-agent = {
enable = true;
extraConfig = "yolo=1";
openssh.privateKeyPath = "/dev/null";
openssh.publicKeyPath = "/dev/null";
hooks.command = "echo test";
inherit tokenPath;
};
test = ''
echo "checking buildkite-agent service in /Library/LaunchDaemons" >&2
grep "org.nixos.buildkite-agent" ${config.out}/Library/LaunchDaemons/org.nixos.buildkite-agent.plist
echo "checking creation of buildkite-agent service config" >&2
script=$(cat ${config.out}/Library/LaunchDaemons/org.nixos.buildkite-agent.plist | awk -F'[< ]' '$3 ~ "^/nix/store/.*" {print $3}')
grep "yolo=1" "$script"
grep "${tokenPath}" "$script"
'';
}