nixpkgs/nixos/modules/services
Vincent Haupert f4af2f267a
nixos/github-runner: init at v2.277.1 (#116775)
* github-runner: init at 2.277.1

* nixos/github-runner: initial version

* nixos/github-runner: add warning if tokenFile in Nix store

* github-runner: don't accept unexpected attrs

* github-runner: formatting nits

* github-runner: add pre and post hooks to checkPhase

* nixos/github-runner: update ExecStartPre= comment

* nixos/github-runner: adapt tokenFile option description

Also note that not only a change to the option value will trigger a
reconfiguration but also modifications to the file's content.

* nixos/github-runner: remove mkDefault for DynamicUser=

* nixos/github-runner: create a parent for systemd dirs

Adds a parent directory "github-runner/" to all of the systemd lifecycle
directories StateDirectory=, RuntimeDirectory= and LogDirectory=.

Doing this has two motivations:

1. Something like this would required if we want to support multiple
   runners configurations. Please note that this is already possible
   using NixOS containers.
2. Having an additional parent directory makes it easier to remap
   any of the directories. Without a parent, systemd is going to
   complain if, for example, the given StateDirectory= is a symlink.

* nixos/github-runner: use specifier to get abs runtime path

* nixos/github-runner: use hostname as default for option `name`

Until now, the runner registration did not set the `--name` argument if
the configuration option was `null`, the default for the option.
According to GitHub's documentation, this instructs the registration
script to use the machine's hostname.

This commit causes the registration to always pass the `--name` argument
to the runner configuration script. The option now defaults to
`networking.hostName` which should be always set on NixOS.

This change becomes necessary as the systemd service name includes the
name of the runner since fcfa809 and, hence, expects it to be set. Thus,
an unset `name` option leads to an error.

* nixos/github-runner: use types.str for `name` option

Forcing a `name` option to comply with a pattern which could also be
used as a hostname is probably not required by GitHub.

* nixos/github-runner: pass dir paths explicitly for ExecStartPre=

* nixos/github-runner: update variable and script naming

* nixos/github-runner: let systemd choose the user/group

User and group naming restrictions are a complex topic [1] that I don't
even want to touch. Let systemd figure out the username and group and
reference it in our scripts through the USER environment variable.

[1] https://systemd.io/USER_NAMES/

* Revert "nixos/github-runner: use types.str for `name` option"

The escaping applied to the subdirectory paths given to StateDirectory=,
RuntimeDirectory= and LogsDirectory= apparently doesn't use the same
strategy that is used to escape unit names (cf. systemd-escape(1)). This
makes it unreasonably hard to construct reliable paths which work for
StateDirectory=/RuntimeDirectory=/LogsDirectory= and ExecStartPre=.

Against this background, I decided to (re-)apply restrictions to the
name a user might give for the GitHub runner. The pattern for
`networking.hostName` seems like a reasonable choice, also as its value
is the default if the `name` option isn't set.

This reverts commit 193ac67ba3.

* nixos/github-runner: use types.path for `tokenFile` option

* nixos/github-runner: escape options used as shell arguments

* nixos/github-runner: wait for network-online.target

* github-runner: ignore additional online tests
2021-04-10 10:17:10 +00:00
..
admin
amqp
audio Merge pull request #117554 from Zopieux/snapcast-meta 2021-04-07 10:30:32 +02:00
backup restic: allow prune without backup 2021-03-21 18:47:52 -07:00
blockchain/ethereum nixos/geth: initial service 2021-02-23 19:28:51 +01:00
cluster treewide: fix eval without aliases after 9378fdf87e 2021-04-08 13:33:09 +02:00
computing nixos/slurm: expose to path config files 2021-03-10 23:12:47 +01:00
continuous-integration nixos/github-runner: init at v2.277.1 (#116775) 2021-04-10 10:17:10 +00:00
databases nixos/redis: allow access to runtime and state directories to only redis user 2021-04-03 19:07:27 +03:00
desktops pipewire: 0.3.24 -> 0.3.25 2021-04-07 16:23:43 +03:00
development Revert "nixos/hoogle: add type" 2021-02-01 17:39:08 +01:00
display-managers nixos/greetd: Add greetd module (#118294) 2021-04-06 19:35:32 +00:00
editors
games nixos/factorio: add nonBlockingSaving option 2021-03-12 10:34:59 -08:00
hardware Merge pull request #113703 from symphorien/disable-sane-master 2021-04-05 13:49:43 +02:00
logging vector: remove deprecated --no-topology 2021-04-05 08:30:52 +09:00
mail nixos/mlmmj: use appropriate postfix options 2021-02-17 16:00:59 +00:00
misc Merge pull request #118719 from dotlambda/home-assistant-tests 2021-04-08 18:19:34 +02:00
monitoring Merge pull request #89267 from mmilata/bitcoin-exporter 2021-04-06 00:08:33 +02:00
network-filesystems nixos/samba: remove bad example for "securityType" option 2021-04-07 14:18:01 +02:00
networking Merge pull request #111316 from higebu/add-gobgpd 2021-04-09 17:17:07 +02:00
printing nixos/printing: simplify filterGutenprint function 2021-03-14 11:59:00 +01:00
scheduling
search nixos/elasticsearch-curator: add type 2021-01-27 11:50:19 -08:00
security iproute: deprecate alias 2021-04-04 01:43:46 +02:00
system treewide: fix eval without aliases after 9378fdf87e 2021-04-08 13:33:09 +02:00
torrent nixos/deluge: add type 2021-01-28 14:30:23 -08:00
ttys nixos/services/kmscon: fix systemd configuration 2021-02-15 16:58:54 -05:00
video
wayland
web-apps Merge pull request #116074 from talyz/discourse 2021-04-08 14:19:49 +02:00
web-servers Merge pull request #116074 from talyz/discourse 2021-04-08 14:19:49 +02:00
x11 nixos/kodi: add package option 2021-03-29 16:47:30 -04:00