Open luochen1990 opened 1 year ago
What hypervisor did you use?
Following are my full nixos config about microvm, I havn't manually specify hypervisor, so it should be the default value qemu :
{ config, pkgs, inputs, ... }:
{
imports = [
inputs.microvm.nixosModules.host
];
config = {
# DOC: https://astro.github.io/microvm.nix/declarative.html
microvm.vms = {
gitlab-runner-vm = {
config = {
# It is highly recommended to share the host's nix-store
# with the VMs to prevent building huge images.
microvm.shares = [{
source = "/nix/store";
mountPoint = "/nix/.ro-store";
tag = "ro-store";
proto = "virtiofs";
}];
microvm.interfaces = [
{
type = "user";
id = config.mainInterface; # interface name on the host
mac = "02:00:00:00:00:01"; # Ethernet address of the MicroVM's interface, not the host's
}
];
# This is necessary to import the host's nix-store database
microvm.writableStoreOverlay = "/nix/.rw-store";
# Any other configuration for your MicroVM
# Gitlab Runner
services.gitlab-runner = {
enable = true;
services = {
mygitlab = {
registrationConfigFile = "/path/to/config";
executor = "shell";
#dockerImage = "nixos/nix:latest";
};
};
};
#Workaround of https://github.com/NixOS/nixpkgs/issues/245365
virtualisation.docker = {
listenOptions = [ "/run/docker.sock" "127.0.0.1:2375" ];
};
systemd.services.gitlab-runner.environment.DOCKER_HOST = "tcp://127.0.0.1:2375";
networking.proxy.allProxy = null; #Workaround of https://github.com/docker-archive/toolbox/issues/539
};
};
};
};
}