{ pkgs, lib, config, ... }: {
  imports = [ ./media.nix ];

  options.mods.docker = {
    enable = lib.mkEnableOption {
      default = false;
      description = "enables docker containers";
    };
  };

  config = lib.mkIf config.mods.docker.enable {
    environment.systemPackages = [
      pkgs.arion

      # Do install the docker CLI to talk to podman.
      # Not needed when virtualisation.docker.enable = true;
      pkgs.docker-client
    ];

    # Arion works with Docker, but for NixOS-based containers, you need Podman
    # since NixOS 21.05.
    # virtualisation.docker.enable = true;
    # virtualisation.podman.enable = true;
    # virtualisation.podman.dockerSocket.enable = true;
    # virtualisation.podman.defaultNetwork.dnsname.enable = true;

    # Use your username instead of `myuser`
    users.extraUsers.${config.mods.user.name}.extraGroups = [ "podman" ];
  };
}
