8.nix-darwin/modules
Vincent Haupert 06f5dab065 github-runners: adapt to NixOS module
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:

- Copies the `options.nix` from the [NixOS module] with only minor
  adaptations. This should help to keep track of any changes to it.
- Respect the `workDir` config option. So far, the implementation didn't
  even read the value of the option.
- Allow configuring a custom user and group.
  If both are `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.
- Also creates the necessary directories for state, logs and the working
  directory (unless `workDir != null`). It uses the following locations:
    * state: `/var/lib/github-runners/${name}`
    * logs: `/var/log/github-runners/${name}`
    * work: The value of `workDir` or `/var/run/github-runners/${name}`
            if (`workDir == null`).
  We have to create the logs directory before starting the service since
  launchd expects that the `Standard{Error,Out}Path` exist. We do this
  by prepending to [`system.activationScripts.launchd.text`].
  All directories belong to the configured `user` and `group`.
- Warn if a `tokenFile` points to the Nix store.

[NixOS module]: 3c30c56/nixos/modules/services/continuous-integration/github-runner/options.nix
[`system.activationScripts.launchd.text`]: bbde06b/modules/system/launchd.nix (L99-L123)
2024-02-28 09:40:25 +01:00
..
documentation Revert "eval-config: set class" 2023-07-24 23:24:20 +01:00
environment treewide: convert all option docs to Markdown 2023-06-24 10:48:55 +01:00
examples Add zsh completions to darwin-rebuld by default 2024-01-27 19:37:27 -08:00
fonts Add type definition on fonts.fontDir.enable 2024-01-16 21:07:41 +08:00
launchd Use nixpkgs generators.toPlist for launchd service generation. 2024-01-27 17:09:41 -08:00
lib treewide: convert all option docs to Markdown 2023-06-24 10:48:55 +01:00
misc treewide: convert all option docs to Markdown 2023-06-24 10:48:55 +01:00
networking fix shell escaping in networking config 2024-01-19 12:16:32 -05:00
nix Dedupe the WorkingDirectory path of the linux-builder 2024-01-15 13:51:34 +01:00
programs Add option to disable zsh global compinit 2024-01-21 03:24:00 -05:00
security security.sudo.extraConfig: init 2024-02-11 14:16:23 -08:00
services github-runners: adapt to NixOS module 2024-02-28 09:40:25 +01:00
system Merge pull request #820 from mhumeSF/reduce-motion 2024-01-03 10:28:40 +00:00
time time: bury useless systemsetup -settimezone output 2023-09-15 15:59:14 -04:00
users fix: set shell for new users, and only known ones 2024-01-20 11:03:15 -05:00
alias.nix Update def and implementation of nix.package to match NixOS module 2022-08-16 10:41:51 -07:00
homebrew.nix Add homebrew.onActivation.extraFlags option 2023-09-11 11:22:23 -07:00
meta.nix treewide: convert all option docs to Markdown 2023-06-24 10:48:55 +01:00
module-list.nix Merge pull request #859 from yaxitech/github-runner 2024-02-18 04:48:38 +00:00