summaryrefslogtreecommitdiffstats
path: root/tests/services-github-runners.nix
blob: 8bd08a668c4c76d9efde4c19ef394f836083d96c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{ config, pkgs, ... }:
{
  services.github-runners."a-runner" = {
    enable = true;
    url = "https://github.com/nixos/nixpkgs";
    tokenFile = "/secret/path/to/a/github/token";
  };

  test = ''
    echo >&2 "checking github-runner service in /Library/LaunchDaemons"
    grep "org.nixos.github-runner-a-runner" ${config.out}/Library/LaunchDaemons/org.nixos.github-runner-a-runner.plist
    grep "<string>_github-runner</string>" ${config.out}/Library/LaunchDaemons/org.nixos.github-runner-a-runner.plist

    echo >&2 "checking for user in /activate"
    grep "GitHub Runner service user" ${config.out}/activate
  '';
}