Move vbox to Hosea

This commit is contained in:
Greg Hellings
2024-04-02 11:55:07 -05:00
parent 52c9502911
commit f1db2b7f6a
2 changed files with 59 additions and 54 deletions
+1 -53
View File
@@ -39,6 +39,7 @@ in {
systemd.services = {
"container@gitlab-runner-qemu" = {
# Now moved to a separate machine
conflicts = [
"container@gitlab-runner-vbox.service"
];
@@ -51,20 +52,6 @@ in {
];
};
};
"container@gitlab-runner-vbox" = {
conflicts = [
"container@gitlab-runner-qemu.service"
];
serviceConfig = {
DevicePolicy = lib.mkForce "auto";
ExecStopPost = [ "${pkgs.kmod}/bin/rmmod vboxnetadp vboxnetflt vboxdrv" ];
ExecStartPre = [
"${pkgs.kmod}/bin/modprobe vboxdrv"
"${pkgs.kmod}/bin/modprobe vboxnetadp"
"${pkgs.kmod}/bin/modprobe vboxnetflt"
];
};
};
gitlab-runner.serviceConfig.EnvironmentFile = config.age.secrets.docker-auth.path;
};
@@ -101,45 +88,6 @@ in {
});
};
#####################################################################################
#################### Virtualbox Runner ##############################################
#####################################################################################
containers.gitlab-runner-vbox = container {
bindMounts = {
"/dev/vboxdrv" = {
hostPath = "/dev/vboxdrv";
isReadOnly = false;
};
"/dev/vboxdrvu" = {
hostPath = "/dev/vboxdrvu";
isReadOnly = false;
};
"/dev/vboxnetctl" = {
hostPath = "/dev/vboxnetctl";
isReadOnly = false;
};
};
hostAddress = "192.168.202.1";
localAddress = "192.168.202.2";
config = ((import ./container-runner.nix) {
inherit inputs overlays;
name = "vbox";
extra = {
systemd.services.gitlab-runner.serviceConfig = {
User = "root";
DynamicUser = lib.mkForce false;
};
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
enableHardening = false;
headless = true;
};
networking.firewall.allowedTCPPorts = [ 18083 ]; # Should be interface for vboxweb
};
});
};
#####################################################################################
#################### Container Podman Runner ########################################
#####################################################################################