Commit graph

401 commits

Author SHA1 Message Date
Florian Klink bccb2f7c84 buildkite-agent: 3.76.2 -> 3.77.0
We can also drop the workaround included in the bump to 3.76.1, as
upstream reverted that behavorial change.
2024-08-08 13:24:15 +03:00
Sandro cfd25f7c6a
Merge pull request #322403 from dadada/dev/gitlab-runner-podman
nixos/gitlab-runner: allow access to podman socket
2024-08-03 16:48:09 +02:00
Florian Klink 129558261d
buildkite-agent: 3.59.0 -> 3.76.1 (#331340)
* buildkite-agent: 3.59.0 -> 3.76.1

* nixos/buildkite-agent: put each agent in its own private /tmp

Workaround for https://github.com/buildkite/agent/issues/2916, but
probably still a good idea.
2024-08-02 21:59:32 +02:00
Florian Sesser 828eb8c574 Gitlab-Runner: Add --post-get-sources-script
`--post-get-sources-script` has been added a while ago.  This
makes it available via the nix configuration.

See https://about.gitlab.com/blog/2023/03/27/changes-to-the-preclonescript/
2024-07-02 14:46:48 +00:00
Florian Sesser 42a2c268f6 preCloneScript is now preGetSourcesScript
The --pre-clone-script service configuration has been deprecated (https://docs.gitlab.com/ee/update/deprecations.html#deprecation-and-planned-removal-for-ci_pre_clone_script-variable-on-gitlab-saas) and replaced by --pre-get-sources-script (https://about.gitlab.com/blog/2023/03/27/changes-to-the-preclonescript/).
2024-07-02 13:23:30 +00:00
Janik H. 76cd1d2211 maintainers: drop janik
I guess my time has come as well...

With this commit, I'm not just dropping my maintainer entry, but I'm also
resigning from my duties as a board observer and NixCon project lead.
I also terminated my Summer of Nix contract today.
I'll also stop hosting the local NixOS meetup.

The only "project" I'll finish under the NixOS Foundation umbrella is
Google Summer of Code because the mentees aren't even remotely
responsible for why I'm leaving, and it would be unfair to leave them
hanging.

I'm grateful for all the things I was able to learn, for all the experiences
I could gather, and for all the friends I made along the way.
NixOS is what makes computers bearable for me, so I'll go and work on
some fork (*something something* you always meet twice in life).
2024-07-02 02:36:42 +02:00
Yaya 6f211d899d nixos/gitlab-runner: Add support runner authentication tokens
Support for *runner registration tokens* is deprecated since GitLab
16.0, has been disabled by default in GitLab 17.0 and will be removed in
GitLab 18.0, as outlined in the [GitLab documentation].

It is possible to [re-enable support for runner registration tokens]
until GitLab 18.0, to prevent the registration workflow from
breaking.

*Runner authentication tokens*, the replacement for registration tokens,
have been available since GitLab 16.0 and are expected to be defined in
the `CI_SERVER_TOKEN` environment variable, instead of the previous
`REGISTRATION_TOKEN` variable.

This commit adds a new option
`services.gitlab-runner.services.<name>.authenticationTokenConfigFile`.
Defining such option next to
`services.gitlab-runner.services.<name>.registrationConfigFile` brings
the following benefits:
- A warning message can be emitted to notify module users about the
  upcoming breaking change with GitLab 17.0, where *runner registration
  tokens* will be disabled by default, potentially disrupting
  operations.
- Some configuration options are no longer supported with *runner
  authentication tokens* since they will be defined when creating a new
  token in the GitLab UI instead. New warning messages can be emitted to
  notify users to remove the affected options from their configuration.
- Once support for *registration tokens* has been removed in GitLab 18,
  we can remove
  `services.gitlab-runner.services.<name>.registrationConfigFile` as
  well and make module users configure an *authentication token*
  instead.

This commit changes the option type of
`services.gitlab-runner.services.<name>.registrationConfigFile` to
`with lib.types; nullOr str` to allow configuring an authentication
token in
`services.gitlab-runner.services.<name>.authenticationTokenConfigFile`
instead.

A new assertion will make sure that
`services.gitlab-runner.services.<name>.registrationConfigFile` and
`services.gitlab-runner.services.<name>.authenticationTokenConfigFile`
are mutually exclusive. Setting both at the same time would not make
much sense in this case.

[GitLab documentation]: https://docs.gitlab.com/17.0/ee/ci/runners/new_creation_workflow.html#estimated-time-frame-for-planned-changes
[re-enable support for runner registration tokens]: https://docs.gitlab.com/17.0/ee/ci/runners/new_creation_workflow.html#prevent-your-runner-registration-workflow-from-breaking
2024-06-25 17:06:45 +02:00
Yaya 92a26526b9 nixos/gitlab-runner: Remove global with lib; 2024-06-25 17:06:45 +02:00
Tim Schubert fc0fdbe85e nixos/gitlab-runner: allow access to podman socket
Allows access to podman control socket to gitlab-runner.
2024-06-25 14:45:04 +02:00
Artturin ef00c78e0d
nixos/jenkins: add RuntimeDirectory
Necessary for jenkins socket which has to be enabled with

`JENKINS_UNIX_DOMAIN_PATH=/run/jenkins/jenkins.socket`

in `services.jenkins.environment`

https://www.github.com/jenkinsci/packaging/issues/455
2024-06-23 18:00:35 +03:00
Robin Appelman c64e560c86 nixos/hydra: fix typo in hydra init script 2024-05-23 19:25:12 +02:00
Adam C. Stephens 95db6c67d7
Merge pull request #303149 from emilylange/forgejo-test-forgejo-actions
nixos/tests/forgejo: refactor and test Forgejo Actions workflow, nixos/gitea-actions-runner: set the `$HOME` environment variable
2024-04-17 08:27:13 -04:00
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
emilylange 2cd2419baf
nixos/gitea-actions-runner: set the $HOME environment variable
This fixes an issue where running the official `actions/checkout` action
from GitHub on a runner with label `:host`, would fail with incredibly
unhelpful error messages.

Turns out, this is due to `$HOME` not being set.
2024-04-10 22:09:55 +02:00
jxd 88d183af85 init 2024-03-27 12:27:19 +08:00
Sandro Jäckel 6cd7477733
nixos/hydra: add option for starman workers
This is useful for small deployments which do not need 5 spare starman
workers taking 160 MB of RAM each.
2024-02-27 15:45:20 +01:00
Artturi dab023d0cc
Merge pull request #287257 from 999eagle/fix/hydra-pg-application-name
nixos/hydra: use set-default in hydra-env wrapper package
2024-02-18 17:21:53 +02:00
Sophie Tauchert b670443f42
nixos/hydra: use set-default in hydra-env wrapper package 2024-02-12 11:16:32 +01:00
Vincent Haupert 6d8391a3ce nixos/github-runners: add a group option to set the executing group
Similar to the `user` option, the added `group` option sets the group of
the executing process. If not `null`, it also sets `DynamicUser=false`.
In case `user` is set to `null` (the default), systemd would run the
service as root implicitly. As this is dangerous and most certainly not
what users want, we force them to set `user = "root"` explicitly if
that's really their intention. That's achieved through an assertion.
2024-02-09 16:58:09 +01:00
Vincent Haupert 35df23c07d nixos/github-runners: set DynamicUser=false if user not null 2024-02-09 16:19:23 +01:00
Vincent Haupert 3f13f8d85e nixos/github-runners: align nodeRuntimes option with package
The `github-runner` package only supports `nodejs_20` since `nodejs_16`
was removed in a2976db919.

It still makes sense to keep the `nodeRuntimes` option as this is
probably not the last Node.js we'll deprecate with at least some grace
period.
2024-02-09 16:19:23 +01:00
Vincent Haupert 782b164523 nixos/github-runners: rework name default 2024-02-09 16:19:19 +01:00
Vincent Haupert 9ad02c831a nixos/github-runner: deprecate module in favor of github-runners.* 2024-02-09 15:14:32 +01:00
Vincent Haupert ab57ba24cf nixos/github-runners: document new runner registrations
Make the documentation of the options `workDir` and `ephemeral` reflect
that changing these options will trigger a new runner registration.
2024-02-09 15:14:32 +01:00
Vincent Haupert a9c807496f nixos/github-runners: add noDefaultLabels option
Add option `noDefaultLabels` which controls the `--no-default-labels`
switch passed to the configure script.
2024-02-09 15:14:32 +01:00
Vincent Haupert ae140cd468 nixos/github-runners: remove superfluous usages of lib 2024-02-09 15:14:31 +01:00
Vincent Haupert e6854b295b nixos/github-runners: only override pkg if it has a nodeRuntimes arg
Older versions of the github-runner package might not have the
`nodeRuntimes` argument yet causing an error as the NixOS module always
tries to override the argument.

The commit makes sure we only override `nodeRuntimes` if the configured
package has a `nodeRuntimes` argument.
2024-02-03 14:33:39 +01:00
Jörg Thalheim 372513f630 nixos/buildbot: don't require network-online.target
The daemon setup itself only requires the firewall to be up.
Workers will connect itself as they can reach the master instance.
That's why we don't need an online target for buildbot to function.
2024-01-22 12:54:42 +01:00
h7x4 d7995e41b6
Merge pull request #277514 from gepbird/github-runner-update-docs
github-runner: mention manpage for serviceOverrides option
2024-01-20 16:57:03 +01:00
Gutyina Gergő 79e8fb92b8
github-runner: mention manpage for serviceOverrides option 2024-01-20 10:22:53 +01:00
Jade Lovelace fe474ed61a nixos: fix remaining services for network-online dep fix 2024-01-19 00:11:34 -08:00
Jade Lovelace 6c5ab28fce nixos: fix a bunch of services missing dep on network-online.target
This was done by generating a truly hilarious configuration:

rg 'services\.[^.]+\.enable\t' opts-tags | cut -f1 > allonconfig.nix

The following were not tested due to other evaluation errors. They
should probably be manually audited.
services.amule
services.castopod
services.ceph
services.chatgpt-retrieval-plugin
services.clamsmtp
services.clight
services.dante
services.dex
services.discourse
services.dwm-status
services.engelsystem
services.foundationdb
services.frigate
services.frp
services.grocy
services.guacamole-client
services.hedgedoc
services.home-assistant
services.honk
services.imaginary
services.jitsi-meet
services.kerberos_server
services.limesurvey
services.mastodon
services.mediawiki
services.mobilizon
services.moodle
services.mosquitto
services.nextcloud
services.nullmailer
services.patroni
services.pfix-srsd
services.pgpkeyserver-lite
services.postfixadmin
services.roundcube
services.schleuder
services.self-deploy
services.slskd
services.spacecookie
services.statsd
services.step-ca
services.sympa
services.tsmBackup
services.vdirsyncer
services.vikunja
services.yandex-disk
services.zabbixWeb
2024-01-19 00:11:34 -08:00
Jade Lovelace 81a3fa04ca nixos/buildbot: master also wants network-online.target 2024-01-18 16:28:42 -08:00
zowoq 3d0b034e87 maintainers/teams: add buildbot 2024-01-05 11:41:19 +10:00
Åsmund Østvold aeeb655646 service buildkite-agent: make it possible add groups to agent users
Only one extra group was add. Some times you want the agents users to
be member of other groups like 'docker'. This change make this possible.

Co-authored-by: Florian Klink <flokli@flokli.de>
2023-12-21 12:49:48 +01:00
Florian Klink 70808d0217 nixos/jenkins: set StateDirectory if home is /var/lib/jenkins
This will cause systemd to chown /var/lib/jenkins to the user that
the jenkins systemd service runs as, fixing permission issues when
mounting /var/lib/jenkins from another data volume.

It uses the same logic that garage is using, too, checking for the
prefix.
2023-12-13 15:15:50 +02:00
zowoq 34deb05e55 nixos/buildbot: fix worker package 2023-12-04 13:55:09 +10:00
h7x4 79d3d59f58
treewide: replace mkPackageOptionMD with mkPackageOption 2023-11-30 19:03:14 +01:00
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Janik H. 15babfbc12
nixos/woodpecker-server: fix environmentFile example 2023-11-02 18:14:46 +01:00
Janik H. 8e5729517e
nixos/woodpecker-server: change type of environmentFile to list of paths 2023-10-31 15:46:53 +01:00
Jörg Thalheim f8be2c43b4 nixos/buildbot: allow to prepend imports 2023-10-02 09:11:39 +10:00
Jörg Thalheim e2106a5dbb nixos/buildbot: make configurators configurable 2023-10-02 09:11:39 +10:00
Janik 1ffb4e592e
Merge pull request #249964 from ambroisie/woodpecker-improvements 2023-09-09 19:30:34 +02:00
Lassulus 72160fbdc1
Merge pull request #251302 from Mic92/buildbot
nixos/buildbot: support reload, buildbot-www-react: init 3.9
2023-09-09 19:09:06 +02:00
nicoo 8bb42ad1af nixos/hail: Remove module 2023-09-08 19:28:49 +00:00
Jörg Thalheim df4236c904 buildbot: supports reloading configuration
buildbot will reload configuration on sighup
2023-09-06 09:38:50 +02:00
Vincent Haupert 388bfcef4a nixos/github-runners: add nodeRuntimes option 2023-08-22 15:52:35 +02:00
Bruno BELANYI 200c3bad42 nixos/woodpecker-agents: add 'path' option
See #249602.
2023-08-20 22:26:52 +02:00
Bruno BELANYI 6dd4c5f73f nixos/woodpecker-agents: use 'literalExample'
The next commit is going to add an option which takes a list of
packages. So the example must be converted to make it documentable.

This will also allow adding comments, to explain why some options are
used.
2023-08-19 16:29:10 +01:00
Bruno BELANYI 7d246a2873 nixos/woodpecker-agents: fix typos in doc
The name of the backend is `local`, not `exec`.

`environmentFile` is supposed to be a list.
2023-08-19 16:28:31 +01:00
Bruno BELANYI f7151209c4 nixos/woodpecker-agents: fix 'podman' example
The name should match the fact that we're using `podman` instead of
`docker`.

And the group was wrong.
2023-08-19 16:28:31 +01:00
Jörg Thalheim 38b2c039bd gitea-actions-runner: restart on failure 2023-08-13 12:54:15 +01:00
DavHau 3d58bac73b services.gitea-actions-runner: make ExecStartPre extensible 2023-08-13 12:54:15 +01:00
Jörg Thalheim 7ad7e99370 nixos/gitea-actions-runner: settings option to configure daemon 2023-08-13 12:54:15 +01:00
Felix Bühler 0a2745684e
Merge pull request #239624 from Stunkymonkey/use-optionalString-then
treewide: use optionalString instead of 'then ""'
2023-07-22 13:02:47 +02:00
Sandro 61dfd95022
Merge pull request #236778 from awakesecurity/jsoo1/buildkite-agent-hooks
nixos/buildkite-agents: simplify service definition
2023-07-17 21:46:12 +02:00
Pol Dellaiera 764472b473
Merge pull request #233091 from yayayayaka/add-team-gitlab
maintainers/team-list: Add team gitlab
2023-07-07 15:19:15 +02:00
Emily d8c2229c49
Merge pull request #226684 from srid/patch-8
nixos/jenkins-job-builder: Fix link to documentation, use mkEnableOption
2023-07-02 19:49:17 +02:00
Sridhar Ratnakumar ac4790a84e
nixos/jenkins-job-builder: Fix link to documentation, use mkEnableOption
Co-Authored-By: emilylange <git@emilylange.de>
2023-07-02 19:07:44 +02:00
Felix Buehler f3719756b5 treewide: use optionalString instead of 'then ""' 2023-06-24 20:19:19 +02:00
John Soo 75f419f222
nixos/buildkite-agents: simplify service definition
* remove `with`

* replace specific hooks with attrsOf lines

  To be flexible, should they change.

* make hooks with writeShellApplication

  - Previously hooks would not build if they used a heredoc with `EOF`
  - To shellcheck hooks

* format with nixpkgs-fmt

* remove removed option module
2023-06-15 16:31:29 -07:00
Pol Dellaiera 7907dd9d6b
Merge pull request #235924 from Stunkymonkey/remove-then-{}
treewide: use lib.optionalAttrs instead of 'then {}'
2023-06-13 20:14:58 +02:00
Tom McLaughlin f69aff8f89 github-runner: add thomasjm as maintainer 2023-06-08 01:03:15 -07:00
Felix Buehler ed3b102d1e treewide: use use lib.optionalAttrs instead of 'then {}' 2023-06-06 22:54:31 +02:00
Ilan Joselevich ebafd551d7
nixos/hercules-ci-agent: sync module with upstream 2023-05-22 15:05:16 +03:00
Yaya 2681d4ff12 nixos/gitlab-runner: Add gitlab team members to maintainers 2023-05-20 20:38:49 +00:00
figsoda 701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Martin Weinelt 1c80c494ca
Merge pull request #228422 from mweinelt/gitea-actions-runner-module
nixos/gitea-actions-runner: init
2023-05-12 17:54:16 +02:00
Martin Weinelt 1c963cea48
nixos/gitea-actions-runner: init 2023-05-06 17:34:15 +02:00
Jörg Thalheim 301d6bb9c2 nixos/hercules-ci-agent: increase stack limit
see https://github.com/hercules-ci/hercules-ci-agent/pull/451 for context
2023-05-02 09:53:41 +02:00
Artturi b83db86a9e
Merge pull request #222080 from Stunkymonkey/nixos-optionalString 2023-04-20 16:07:30 +03:00
Jörg Thalheim 90b750456e buildbot: move out of python3.pkgs
By moving it out we can start apply overrides to python dependendencies
starting with sqlalchemy.

This fixes the build with the current version.
2023-04-11 12:38:58 +02:00
Felix Buehler 327b0cff7a treewide: use more lib.optionalString 2023-04-07 13:38:33 +02:00
Bruno BELANYI 6048912d8b nixos/woodpecker-*: add myself as maintainer 2023-03-23 21:33:21 +00:00
Bruno BELANYI 67de7d105e nixos/woodpecker-agents: per-agent 'enable' option 2023-03-23 21:33:20 +00:00
Bruno BELANYI cd116db45e nixos/woodpecker-agents: bind network files
Otherwise the agent might experience trouble with DNS resolution [1].

[1]: https://github.com/woodpecker-ci/plugin-git/issues/65
2023-03-23 14:16:45 +00:00
Bruno BELANYI eb3bea6359 nixos/woodpecker-agents: simplify 'extraGroups' handling 2023-03-23 14:16:45 +00:00
Bruno BELANYI c3afdb82db nixos/woodpecker-agents: use list for environment files 2023-03-23 14:16:44 +00:00
Bruno BELANYI e4f5f1b718 nixos/woodpecker: refactor to multi-agents setup
The module file has been renamed from `agent.nix` to `agents.nix` to
mirror the change.
2023-03-23 12:47:47 +00:00
Janik H dafedbbba6 nixos/woodpecker: init 2023-03-14 20:31:39 +01:00
Rick van Schijndel 8d8f5ede91
Merge pull request #216451 from Mindavi/hydra/systemd-target
nixos/hydra: wait for network-online before evaluator start
2023-03-09 20:53:21 +01:00
Rick van Schijndel 60446dda1f nixos/hydra: wait for network-online before evaluator start
This prevents issues I'm seeing with the hydra I'm running on my laptop.
Every time I reboot it I see eval errors like this:

```
error fetching latest change from git repo at `https://github.com/nixos/nixpkgs.git':
fatal: unable to access 'https://github.com/nixos/nixpkgs.git/': Could not resolve host: github.com
```

This is because the evaluator already starts before the network is
actually online. It should wait until the network is fully online before
starting evaluation to prevent evaluation errors like above.
2023-03-07 21:58:23 +01:00
Ilan Joselevich edff57cff4
Merge pull request #218455 from veehaitch/gh-runner-builddotnet
github-runner: switch to `buildDotnetModule`
2023-03-06 19:11:06 +02:00
Stefan Frijters 2af041ab44 nixos/gitlab-runner: do not pull in Docker if gitlab-runner-clear-docker-cache is disabled
Only create the service if the option is enabled and if any docker executors exist.
2023-02-27 22:24:14 +01:00
Vincent Haupert 137db83090 nixos/github-runners: use Runner.Listener directly for registration
Nothing the script `config.sh` does prior to the final call to
`Runner.Listener configure` is relevant for the systemd service.
Particularly, we don't need (nor want) any of the artifacts the `env.sh`
script creates.
2023-02-26 15:39:19 +01:00
Aaron Andersen d8c0a9204a
Merge pull request #217834 from yaxitech/gh-runner-workdir-clean
nixos/github-runners: clean `workDir` as root
2023-02-26 08:05:05 -05:00
Profpatsch d316c28a30 modules/github-runner: Improve tokenFile docs
We’ve been having trouble figuring out which kind of token to use and
why our setup would break every few system updates.

This should clarify which options there are, and which ones lead to
better results.

Ideally there would be a manual section that has a step-by-step guide
on how to set up the github runner, with screenshots and everything.
2023-02-23 12:37:30 +01:00
Vincent Haupert 36949b9718 nixos/github-runners: clean workDir as root
Purge contents of `workDir` as root to also allow the removal of files
marked as read-only. It is easy to create read-only files in `workDir`,
e.g., by copying files from the Nix store.
2023-02-23 09:05:27 +01:00
Karel Kočí 116872aedd
nixos/gitlab-runner: fix shell syntax preventing build
The build fails when configFile is provided because of shellcheck
detects missing quotes here.
2023-02-13 13:20:26 +01:00
Vincent Haupert 57a517db35 nixos/github-runner{,s}: add @veehaitch and @newam as maintainers 2023-01-09 09:37:00 +01:00
Vincent Haupert b634dbe576 nixos/github-runners: fix format of service file 2023-01-09 09:36:59 +01:00
Vincent Haupert 66dbf9b199 nixos/github-runners: use mkMerge for serviceConfig
The `serviceOverrides` module option is commonly used to loosen the
systemd unit's hardening. This commit merges the `serviceConfig` with
`mkMerge` instead of using the update operator `//` which discards all
existing values on conflict. To avoid a breaking change which requires
defining each option with a higher priority (e.g., through `mkForce`),
this commit prefixes hardening values with `mkDefault`.

Notable exceptions are list hardening options which use `mkBefore`
instead of `mkDefault`. This allows for easy extension of the existing
settings. Resetting redefinitions are still possible through `mkForce`.
2023-01-09 09:36:04 +01:00
Aaron Andersen 4769274f53
Merge pull request #205526 from newAM/github-runner-oom
nixos/github-runner: add workDir option
2023-01-08 19:01:44 -05:00
Maciej Pasternacki c3ec444a61 nixos/gitlab-runner: fix style issues flagged by statix 2023-01-08 17:37:43 +01:00
Maciej Pasternacki d5cb89b024 nixos/gitlab-runner: fix problems introduced by last #209716 2023-01-08 17:36:45 +01:00
Matthieu Coudron c61f554c1a modules.gitlab-runner: accept space in names
when you register a runner with spaces in its name (possible if you use 'description' option) then the runners never get unregistered because our bash scripts assume no space in names.

This solves the issue

Retreiving the fullname of the runner via `gitlab-runner list` got surprisingly hard between lazy-capture issues and `gitlab-runner list` displaying invisible (CSI) characters that break the regex etc.
Which is why I fell back on the pseudo-json format.

This PR adds the hash in the name, which allows to keep both the
stateless aspect of the module while allowing for a freeform name.

I found using bash associative arrays easier to use/debug than the current
approach.
2023-01-05 11:43:32 +01:00
Alex Martens 307730fb72 nixos/github-runner: add workDir option 2023-01-03 19:54:25 -08:00
figsoda 6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Daniel Nagy ad866e565d
treewide: switch to port type for nixos modules 2022-12-08 00:00:00 +01:00