73 lines
1.6 KiB
Nix
Raw Normal View History

2023-01-26 00:24:32 +03:00
{ config, pkgs, lib, ... }: {
2023-03-23 01:53:51 +03:00
boot.kernelModules = [ "x_tables" ];
2023-01-13 04:03:15 +03:00
2023-05-24 21:29:27 +03:00
environment.systemPackages = [ pkgs.virtiofsd ];
2023-01-26 00:24:32 +03:00
virtualisation = {
oci-containers.backend = lib.mkForce "podman";
docker.enable = lib.mkForce false;
podman = {
enable = true;
extraPackages = [ pkgs.zfs ];
2023-01-26 04:45:14 +03:00
dockerSocket.enable = true;
2023-01-26 00:24:32 +03:00
};
containers.registries.search = [
"docker.io" "gcr.io" "quay.io"
];
containers.storage.settings = {
storage = {
2023-12-18 02:08:29 +03:00
driver = "overlay";
# driver = "zfs";
2023-01-26 00:24:32 +03:00
graphroot = "/var/lib/podman/storage";
runroot = "/run/containers/storage";
};
};
lxd = {
enable = true;
zfsSupport = true;
recommendedSysctlSettings = true;
};
lxc = {
enable = true;
lxcfs.enable = true;
systemConfig = ''
lxc.lxcpath = /var/lib/lxd/containers
lxc.bdev.zfs.root = rpool/persistent/lxd
'';
};
libvirtd = {
enable = true;
qemu = {
ovmf.enable = true;
2023-02-14 07:04:20 +03:00
ovmf.packages = [
pkgs.OVMFFull.fd
];
2023-01-26 00:24:32 +03:00
runAsRoot = false;
};
onBoot = "ignore";
onShutdown = "shutdown";
};
};
security.unprivilegedUsernsClone = true;
2023-01-13 04:03:15 +03:00
home-manager.users.${config.mainuser} = {
home.file.".config/containers/storage.conf".text = ''
[storage]
driver = "overlay"
'';
};
2023-01-26 00:24:32 +03:00
users.users.${config.mainuser} = {
subUidRanges = [{
count = 1000;
startUid = 10000;
}];
subGidRanges = [{
count = 1000;
startGid = 10000;
}];
};
2023-11-11 03:14:56 +03:00
2023-11-17 00:00:55 +03:00
networking.firewall.interfaces."podman+".allowedUDPPorts = [ 53 ];
2023-01-26 00:24:32 +03:00
}