32 lines
816 B
Nix
32 lines
816 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
cfg = config.frajul.gitlab-runner;
|
|
in {
|
|
options = {
|
|
frajul.gitlab-runner = {
|
|
enable = lib.mkEnableOption "gitlab-runner";
|
|
secretsFile = lib.mkOption {
|
|
type = lib.types.path;
|
|
description = "A sops encrpyted file containing a 'gitlab_runner_token' secret";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
services.gitlab-runner.enable = true;
|
|
|
|
sops.secrets."gitlab_runner_token".sopsFile = cfg.secretsFile;
|
|
services.gitlab-runner.services.default = {
|
|
# File should contain at least these two variables:
|
|
authenticationTokenConfigFile = config.sops.secrets."gitlab_runner_token".path;
|
|
dockerImage = "alpine:latest";
|
|
dockerVolumes = [
|
|
"/var/run/docker.sock:/var/run/docker.sock"
|
|
];
|
|
};
|
|
};
|
|
}
|