{ pkgs, config, lib, ... }:

let
  cfg = config.system.docker;
in
{
  options.system.docker = {
    enable = lib.mkEnableOption "enables docker";
  };

  config = lib.mkIf cfg.enable {

    virtualisation.docker = {
      enable = true;
      daemon.settings.features.cdi = true;
      rootless.daemon.settings.features.cdi = true;
      daemon.settings = {
        experimental = true;
      };
    };
  };
}
