builder: massive config cleanup, breakdown into modules, use disko
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
{
|
||||
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"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user