This commit is contained in:
alisceon 2025-09-29 16:55:37 +02:00
parent 0875ebe6dd
commit a95cbb9147

View file

@ -28,7 +28,9 @@
# Persist GitLab Runner state on the host (tokens, cache, builds)
# so the container can be rebuilt without losing registration.
systemd.tmpfiles.rules = [
"d /var/lib/gitlab-runner 0755 root root -"
"d /var/lib/gitlab-runner 0755 root root -"
"d /var/lib/gitlab-runner/builds 0755 root root -"
"d /var/lib/gitlab-runner/cache 0755 root root -"
];
containers.gitlab-runner = {
@ -43,26 +45,20 @@
allowedDevices = [
{ node = "/dev/fuse"; modifiers = [ "rwm" ]; }
];
# Persist runners home/state and optionally cache
bindMounts = {
"/var/lib/gitlab-runner" = {
hostPath = "/var/lib/gitlab-runner";
isReadOnly = false;
};
# Optional: a big builds/cache dir for job artifacts
"/var/lib/gitlab-runner/builds" = {
hostPath = "/var/lib/gitlab-runner/builds";
isReadOnly = false;
create = true;
};
"/var/lib/gitlab-runner/cache" = {
hostPath = "/var/lib/gitlab-runner/cache";
isReadOnly = false;
create = true;
};
};
# The container runs its own NixOS config below:
config = { config, pkgs, lib, ... }: {
imports = [ ];