Commit Graph

33 Commits

Author SHA1 Message Date
Yaya
2681d4ff12 nixos/gitlab-runner: Add gitlab team members to maintainers 2023-05-20 20:38:49 +00: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
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
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
figsoda
6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Robert Kovacsics
c8eae7a526 nixos/gitlab-runner: Add gitlab-runner.clear-docker-cache service 2022-10-10 18:17:19 +01:00
pennae
ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00
pennae
61e93df189 nixos/*: automatically convert option docs to MD
once again using nix-doc-munge (69d080323a)
2022-08-03 22:46:41 +02:00
misuzu
9b1db3db0e nixos/gitlab-runner: undeprecate configFile option 2022-07-28 17:16:55 +02:00
misuzu
b4028126f1 nixos/gitlab-runner: add settings option 2022-07-28 17:16:55 +02:00
Matthieu Coudron
c1e318d0c5 services.gitlab-runner: support runner description
The description for the runner in the UI is by default sthg like
"npm_nixos_d0544ed48909" i.e., the name of the attribute.

I wanted to have a more user-friendly description and added a
description to the service.
Seems like gitlab-runner doesn't like having both fields set:
"Cannot use two forms of the same flag: description name"
so I used one or the other.
2022-04-26 11:43:46 +02:00
polykernel
4a9d9928dc nixos/nix-daemon: use structural settings
The `nix.*` options, apart from options for setting up the
daemon itself, currently provide a lot of setting mappings
for the Nix daemon configuration. The scope of the mapping yields
convience, but the line where an option is considered essential
is blurry. For instance, the `extra-sandbox-paths` mapping is
provided without its primary consumer, and the corresponding
`sandbox-paths` option is also not mapped.

The current system increases the maintenance burden as maintainers have to
closely follow upstream changes. In this case, there are two state versions
of Nix which have to be maintained collectively, with different options
avaliable.

This commit aims to following the standard outlined in RFC 42[1] to
implement a structural setting pattern. The Nix configuration is encoded
at its core as key-value pairs which maps nicely to attribute sets, making
it feasible to express in the Nix language itself. Some existing options are
kept such as `buildMachines` and `registry` which present a simplified interface
to managing the respective settings. The interface is exposed as `nix.settings`.

Legacy configurations are mapped to their corresponding options under `nix.settings`
for backwards compatibility.

Various options settings in other nixos modules and relevant tests have been
updated to use structural setting for consistency.

The generation and validation of the configration file has been modified to
use `writeTextFile` instead of `runCommand` for clarity. Note that validation
is now mandatory as strict checking of options has been pushed down to the
derivation level due to freeformType consuming unmatched options. Furthermore,
validation can not occur when cross-compiling due to current limitations.

A new option `publicHostKey` was added to the `buildMachines`
submodule corresponding to the base64 encoded public host key settings
exposed in the builder syntax. The build machine generation was subsequently
rewritten to use `concatStringsSep` for better performance by grouping
concatenations.

[1] - https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2022-01-26 21:04:50 -05:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
misuzu
bdc96d3351 nixos/gitlab-runner: warn about possible secrets leak 2021-02-03 17:18:49 +02:00
misuzu
1e38f0bdf9
nixos/gitlab-runner: add support for 'docker+machine' and 'docker-ssh+machine' executors (#108763) 2021-01-26 00:01:54 +00:00
Graham Christensen
bc49a0815a
utillinux: rename to util-linux 2020-11-24 12:42:06 -05:00
Milan
e49fb87b05
nixos/gitlab-runner: add clone-url option (#93894) 2020-07-30 10:24:33 +02:00
misuzu
fc9f994ee5
nixos/gitlab-runner: add more global options (#86946) 2020-06-29 13:35:21 +00:00
misuzu
0b0afcae16 nixos/gitlab-runner: support multiple services 2020-05-02 11:59:57 +02:00
zowoq
c59c4e3589 nixos/*: use $out instead of $bin with buildGoPackage 2020-04-28 20:30:29 +10:00
Ben Gamari
848af2c6fc nixos/gitlab-runner: reload on config change
With this change it is no longer required to restart the runner on every
change. Instead it can just reload it's config while running.
2019-11-27 23:00:29 +01:00
Pascal Bach
02ed974bba nixos/gitlab-runner: add missing HOME to environment (#67450)
Gitlab runner fails to start if HOME is not set.
2019-08-28 20:27:28 +00:00
Symphorien Gibol
a915b33315 nixos: add preferLocalBuild=true; on derivations for config files 2019-02-22 20:11:27 +01:00
Florian Klink
fff5923686 nixos/modules: users.(extraUsers|extraGroup->users|group) 2018-06-30 03:02:58 +02:00
Pascal Bach
233781410d gitlab-runner service: allow adding additional tools to PATH
This is similar to how it is implemented for the Jenkins service.

Bash and docker-machine are added by default as they are required in
many cases.
2017-08-30 13:58:47 +02:00
Pascal Bach
73c4a3f641 gitlab-runner service: honor proxy variables 2017-08-30 13:58:46 +02:00
makefu
e6785422ae
module gitlab-runner: introduce configOptions and configFile
Also removes configText, functionality is now provided more conveniently by configOptions.
Keep in mind that this breaks compatibility with previous configurations,
configFile provides a means to protect the CI token from being written into the nix store.
2017-08-15 16:06:55 +02:00
Pascal Bach
c725924dfd gitlab-runner service: support graceful termination (#27222)
The current behavior was for gitlab-runner is to immediately terminate when there
was a restart required. This can lead to aborted builds and is annoying to users.

By enabling graceful mode gitlab-runner will wait for all builds to finish before
terminating. The disadvantage is that a nixos-rebuild switch needs to wait till
all jobs are done. Because of that it is not enabled by default.
2017-07-11 15:38:46 +01:00
Franz Pletz
0cd0581b75
gitlab-runner service: only depend on docker if enabled 2017-05-14 22:47:35 +02:00
Pascal Bach
8373124202 gitlab-runner: make v1 runner available
gitlab-runner 9.0.0 is only compatible with gitlab >= 9.0
gitlab-runner1 1.11.1 is only compatible with gitlab < 9.4
2017-03-28 21:02:43 +02:00
Pascal Bach
de38c1bca0 gitlab-runner service: initial version 2016-09-23 22:39:12 +02:00