mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
21b92addaf
Adds a new module which allows to configure multiple GitHub self-hosted runners on Darwin. The module is heavily inspired by the nixpkgs NixOS module. Its implementation differs in some ways: - There's currently no way to configure the user/group which runs the runner. All configured runners share the same user and group. - No automatic cleanup. - No advanced sandboxing apart from user/group isolation
23 lines
797 B
Nix
23 lines
797 B
Nix
{ config, pkgs, ... }:
|
|
{
|
|
users = {
|
|
knownUsers = [ "github-runner" ];
|
|
knownGroups = [ "github-runner" ];
|
|
};
|
|
|
|
services.github-runners."a-runner" = {
|
|
enable = true;
|
|
url = "https://github.com/nixos/nixpkgs";
|
|
tokenFile = pkgs.writeText "fake-token" "not-a-token";
|
|
package = pkgs.runCommand "github-runner-0.0.0" { } "touch $out";
|
|
};
|
|
|
|
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
|
|
'';
|
|
}
|