Has anybody a working example of a Gitlab runner with a containerized Nix daemon as demonstrated in:
https://nixos.wiki/wiki/Gitlab_runner
Sadly this file is quite outdated. And the current settings in nixos-unstable
function differently.
Does anybody know if this setup like:
{
config,
lib,
pkgs,
inputs,
...
}:
let
localNix = import (inputs.nix.outPath + "/docker.nix") {
pkgs = pkgs;
name = "local/nix";
tag = "latest";
bundleNixpkgs = false;
extraPkgs = with pkgs; [ cachix ];
nixConf = {
cores = "0";
experimental-features = [
"nix-command"
"flakes"
];
};
};
localNixDaemon = pkgs.dockerTools.buildLayeredImage {
fromImage = localNix;
name = "local/nix-daemon";
tag = "latest";
config = {
Volumes = {
"/nix/store" = { };
"/nix/var/nix/db" = { };
"/nix/var/nix/daemon-socket" = { };
};
};
maxLayers = 125;
};
in
{
virtualisation.docker = {
enable = true;
autoPrune = {
enable = true;
dates = "daily";
};
};
# Common container for the Gitlab Nix runner
virtualisation.oci-containers = {
backend = "docker";
containers.gitlabnix = {
imageFile = localNixDaemon;
image = "local/nix-daemon:latest";
cmd = [
"nix"
"daemon"
];
};
};
}
# Now define the Gitlab Runner here...