github-runners: adapt to NixOS module #893
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While #859 added basic support for configuring GitHub runners through nix-darwin, it did not yet support all of the options the NixOS module offers.
I am aware that this is a rather big overhaul. I think, however, that it's worth it:
options.nix
from the NixOS module with only minor adaptations. This should help to keep track of any changes to it.workDir
config option. So far, the implementation didn't even read the value of the option.null
, nix-darwin manages the_github-runner
user shared among all instances. Take care of creating your own users if that's not what you want.workDir != null
). It uses the following locations: * state:/var/lib/github-runners/${name}
* logs:/var/log/github-runners/${name}
* work: The value ofworkDir
or/var/run/github-runners/${name}
if (workDir == null
). We have to create the logs directory before starting the service since launchd expects that theStandard{Error,Out}Path
exist. We do this by prepending tosystem.activationScripts.launchd.text
. All directories belong to the configureduser
andgroup
.tokenFile
points to the Nix store.