{ pkgs, lib, config, ... }: with lib; { options.virtualisation.containerManagement = mkOption { type = types.enum [ "docker" "podman" ]; default = "docker"; }; config = { virtualisation = { containers = { # Enable common container config files in /etc/containers enable = true; }; libvirtd = { enable = true; qemu = { vhostUserPackages = [ pkgs.virtiofsd ]; }; }; # remember to add the necessary users to the podman group podman = { enable = if (config.virtualisation.containerManagement == "podman") then true else false; dockerSocket.enable = true; dockerCompat = true; defaultNetwork.settings.dns_enabled = true; }; # remember to add the necessary users to the docker group docker = { enable = if (config.virtualisation.containerManagement == "docker") then true else false; storageDriver = "btrfs"; }; waydroid = { enable = true; package = pkgs.waydroid-nftables; }; }; programs.virt-manager.enable = true; environment.systemPackages = with pkgs;[ waydroid-helper ] ++ optionals (config.virtualisation.containerManagement == "podman") [ docker-compose # podman-compose podman-tui podman-desktop ] ++ optionals (config.virtualisation.containerManagement == "docker") [ lazydocker ]; }; }