forked from hacc/haccfiles
hainich: add nix gitlab-runner
Signed-off-by: hexchen <hexchen@lilwit.ch>
This commit is contained in:
parent
fd03b5dc9f
commit
c7fe6580f8
1 changed files with 40 additions and 5 deletions
|
@ -4,12 +4,47 @@
|
||||||
services.gitlab-runner = {
|
services.gitlab-runner = {
|
||||||
enable = true;
|
enable = true;
|
||||||
concurrent = 4;
|
concurrent = 4;
|
||||||
services.infra4future = {
|
services = {
|
||||||
|
infra4future = {
|
||||||
buildsDir = "/var/lib/gitlab-runner/builds";
|
buildsDir = "/var/lib/gitlab-runner/builds";
|
||||||
dockerImage = "nixos/nix";
|
dockerImage = "nixos/nix";
|
||||||
executor = "docker";
|
executor = "docker";
|
||||||
registrationConfigFile = "/run/gitlab-runner.env";
|
registrationConfigFile = "/run/gitlab-runner.env";
|
||||||
};
|
};
|
||||||
|
nix = {
|
||||||
|
registrationConfigFile = "/run/gitlab-runner.env";
|
||||||
|
dockerImage = "alpine";
|
||||||
|
dockerVolumes = [
|
||||||
|
"/nix/store:/nix/store:ro"
|
||||||
|
"/nix/var/nix/db:/nix/var/nix/db:ro"
|
||||||
|
"/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro"
|
||||||
|
];
|
||||||
|
dockerDisableCache = true;
|
||||||
|
preBuildScript = pkgs.writeScript "setup-container" ''
|
||||||
|
mkdir -p -m 0755 /nix/var/log/nix/drvs
|
||||||
|
mkdir -p -m 0755 /nix/var/nix/gcroots
|
||||||
|
mkdir -p -m 0755 /nix/var/nix/profiles
|
||||||
|
mkdir -p -m 0755 /nix/var/nix/temproots
|
||||||
|
mkdir -p -m 0755 /nix/var/nix/userpool
|
||||||
|
mkdir -p -m 1777 /nix/var/nix/gcroots/per-user
|
||||||
|
mkdir -p -m 1777 /nix/var/nix/profiles/per-user
|
||||||
|
mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root
|
||||||
|
mkdir -p -m 0700 "$HOME/.nix-defexpr"
|
||||||
|
. ${pkgs.nix}/etc/profile.d/nix.sh
|
||||||
|
${pkgs.nix}/bin/nix-env -i ${lib.concatStringsSep " " (with pkgs; [ nix cacert git openssh ])}
|
||||||
|
${pkgs.nix}/bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable
|
||||||
|
${pkgs.nix}/bin/nix-channel --update nixpkgs
|
||||||
|
'';
|
||||||
|
environmentVariables = {
|
||||||
|
ENV = "/etc/profile";
|
||||||
|
USER = "root";
|
||||||
|
NIX_REMOTE = "daemon";
|
||||||
|
PATH = "/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin";
|
||||||
|
NIX_SSL_CERT_FILE = "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt";
|
||||||
|
};
|
||||||
|
tagList = [ "nix" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.gitlab-runner.serviceConfig = {
|
systemd.services.gitlab-runner.serviceConfig = {
|
||||||
|
|
Loading…
Reference in a new issue