nixos/common/virt.nix
2020-05-14 23:37:19 +02:00

85 lines
2.1 KiB
Nix

{ pkgs, ...}:
{
boot.kernelModules = ["kvm-intel"];
# virtualisation.libvirtd.enable = true;
# To map subuid and subguid for your user and allow rootless containers
users.users.chris.extraGroups = [ "docker" ];
virtualisation = {
docker = {
enable = true;
# Create a `docker` alias for podman, to use it as a drop-in replacement
#dockerCompat = true;
};
};
virtualisation.virtualbox.host.enable = true;
virtualisation.virtualbox.host.enableExtensionPack = true;
users.extraGroups.vboxusers.members = [ "chris" ];
# environment.systemPackages = with pkgs; [ podman runc conmon slirp4netns fuse-overlayfs ];
# users.users.chris.subUidRanges = [{ startUid = 100000; count = 65536; }];
# users.users.chris.subGidRanges = [{ startGid = 100000; count = 65536; }];
# environment.etc."containers/policy.json" = {
# mode="0644";
# text=''
# {
# "default": [
# {
# "type": "insecureAcceptAnything"
# }
# ],
# "transports":
# {
# "docker-daemon":
# {
# "": [{"type":"insecureAcceptAnything"}]
# }
# }
# }
# '';
# };
# environment.etc."containers/registries.conf" = {
# mode="0644";
# text=''
# [registries.search]
# registries = ['docker.io', 'quay.io']
# '';
# };
# environment.etc."cni/net.d/00-loopback.conf".text = ''
# {
# "cniVersion": "0.3.0",
# "type": "loopback"
# }
# '';
# environment.etc."cni/net.d/87-podman-bridge.conflist".text = ''
# {
# "cniVersion": "0.3.0",
# "name": "podman",
# "plugins": [
# {
# "type": "bridge",
# "bridge": "cni0",
# "isGateway": true,
# "ipMasq": true,
# "ipam": {
# "type": "host-local",
# "subnet": "10.88.0.0/16",
# "routes": [
# { "dst": "0.0.0.0/0" }
# ]
# }
# },
# {
# "type": "portmap",
# "capabilities": {
# "portMappings": true
# }
# }
# ]
# }
# '';
}